From faa358e797128ab07bb5644ce305a832d59e5596 Mon Sep 17 00:00:00 2001 From: CoderForTheBetter Date: Wed, 28 Nov 2018 03:38:50 -0500 Subject: 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). --- src/server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index 895e2bb80..ed1ac326e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1835,14 +1835,14 @@ void Server::SendMovePlayer(session_t peer_id) assert(sao); NetworkPacket pkt(TOCLIENT_MOVE_PLAYER, sizeof(v3f) + sizeof(f32) * 2, peer_id); - pkt << sao->getBasePosition() << sao->getPitch() << sao->getYaw(); + pkt << sao->getBasePosition() << sao->getLookPitch() << sao->getRotation().Y; { v3f pos = sao->getBasePosition(); verbosestream << "Server: Sending TOCLIENT_MOVE_PLAYER" << " pos=(" << pos.X << "," << pos.Y << "," << pos.Z << ")" - << " pitch=" << sao->getPitch() - << " yaw=" << sao->getYaw() + << " pitch=" << sao->getLookPitch() + << " yaw=" << sao->getRotation().Y << std::endl; } -- cgit v1.2.3