From 35445d24f425c6291a0580b468919ca83de716fd Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Thu, 13 May 2021 19:34:32 +0200 Subject: Make set_pitch and set_yaw more accurate by not rounding it to integers --- src/script/lua_api/l_localplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script/lua_api/l_localplayer.cpp') diff --git a/src/script/lua_api/l_localplayer.cpp b/src/script/lua_api/l_localplayer.cpp index b8673379a..4f57ee00f 100644 --- a/src/script/lua_api/l_localplayer.cpp +++ b/src/script/lua_api/l_localplayer.cpp @@ -84,7 +84,7 @@ int LuaLocalPlayer::l_set_yaw(lua_State *L) LocalPlayer *player = getobject(L, 1); if (lua_isnumber(L, 2)) { - int yaw = lua_tonumber(L, 2); + double yaw = lua_tonumber(L, 2); player->setYaw(yaw); g_game->cam_view.camera_yaw = yaw; g_game->cam_view_target.camera_yaw = yaw; @@ -104,7 +104,7 @@ int LuaLocalPlayer::l_set_pitch(lua_State *L) LocalPlayer *player = getobject(L, 1); if (lua_isnumber(L, 2)) { - int pitch = lua_tonumber(L, 2); + double pitch = lua_tonumber(L, 2); player->setPitch(pitch); g_game->cam_view.camera_pitch = pitch; g_game->cam_view_target.camera_pitch = pitch; -- cgit v1.2.3