get_pitch/yaw modulo

This commit is contained in:
cora 2020-11-15 00:09:31 +01:00 committed by Schmappie Eldress
parent a17def93c3
commit b9ed498afb

View File

@ -78,7 +78,7 @@ int LuaLocalPlayer::l_get_yaw(lua_State *L)
{ {
LocalPlayer *player = getobject(L, 1); LocalPlayer *player = getobject(L, 1);
lua_pushnumber(L, player->getYaw()); lua_pushnumber(L, fmod( player->getYaw(), 360.0f ));
return 1; return 1;
} }
@ -86,7 +86,7 @@ int LuaLocalPlayer::l_get_pitch(lua_State *L)
{ {
LocalPlayer *player = getobject(L, 1); LocalPlayer *player = getobject(L, 1);
lua_pushnumber(L, player->getPitch()); lua_pushnumber(L, fmod(player->getPitch(), 360.0f ));
return 1; return 1;
} }