mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02:00
Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)
* Adds Lua methods 'set_rotation()' and 'get_rotation'. Also changed some method names to be more clear. Instead of an f32 being sent over network for yaw, now a v3f is sent for rotation on xyz axes. Perserved Lua method set_yaw/setyaw so that old mods still work, other wise to set yaw they would need to switch to set_rotation(0, yaw, 0).
This commit is contained in:
committed by
Loïc Blot
parent
9519d57017
commit
faa358e797
@@ -41,8 +41,8 @@ void PlayerDatabaseFiles::serialize(std::ostringstream &os, RemotePlayer *player
|
||||
sanity_check(player->getPlayerSAO());
|
||||
args.setS32("hp", player->getPlayerSAO()->getHP());
|
||||
args.setV3F("position", player->getPlayerSAO()->getBasePosition());
|
||||
args.setFloat("pitch", player->getPlayerSAO()->getPitch());
|
||||
args.setFloat("yaw", player->getPlayerSAO()->getYaw());
|
||||
args.setFloat("pitch", player->getPlayerSAO()->getLookPitch());
|
||||
args.setFloat("yaw", player->getPlayerSAO()->getRotation().Y);
|
||||
args.setS32("breath", player->getPlayerSAO()->getBreath());
|
||||
|
||||
std::string extended_attrs;
|
||||
|
Reference in New Issue
Block a user