From b9ed498afba85f942952975fa848c0a859dbfac2 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 15 Nov 2020 00:09:31 +0100 Subject: [PATCH] get_pitch/yaw modulo --- src/script/lua_api/l_localplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/lua_api/l_localplayer.cpp b/src/script/lua_api/l_localplayer.cpp index dd0271a17..6ab4907e8 100644 --- a/src/script/lua_api/l_localplayer.cpp +++ b/src/script/lua_api/l_localplayer.cpp @@ -78,7 +78,7 @@ int LuaLocalPlayer::l_get_yaw(lua_State *L) { LocalPlayer *player = getobject(L, 1); - lua_pushnumber(L, player->getYaw()); + lua_pushnumber(L, fmod( player->getYaw(), 360.0f )); return 1; } @@ -86,7 +86,7 @@ int LuaLocalPlayer::l_get_pitch(lua_State *L) { LocalPlayer *player = getobject(L, 1); - lua_pushnumber(L, player->getPitch()); + lua_pushnumber(L, fmod(player->getPitch(), 360.0f )); return 1; }