diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-05-13 19:34:32 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-05-13 19:34:32 +0200 |
commit | 35445d24f425c6291a0580b468919ca83de716fd (patch) | |
tree | 70243765dc1743a83596f9c6eec122fb417ef92c /src/script/lua_api/l_localplayer.cpp | |
parent | 5131675a60a73ebc2bb06e343e296950682e3631 (diff) | |
download | dragonfireclient-35445d24f425c6291a0580b468919ca83de716fd.tar.xz |
Make set_pitch and set_yaw more accurate by not rounding it to integers
Diffstat (limited to 'src/script/lua_api/l_localplayer.cpp')
-rw-r--r-- | src/script/lua_api/l_localplayer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; |