diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-15 13:38:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 13:38:49 +0100 |
commit | e16bbc1fb2fa9d92aa79ffe4219854b9b12287ed (patch) | |
tree | a8e48deed6917ace1f7ad342d59ba22870458f48 /src/script/lua_api | |
parent | 3e7c5d72034931af2da86a1dba9fec556a365ee3 (diff) | |
parent | 1780adeea63630e67f4af8b300f6ae710d9af486 (diff) | |
download | dragonfireclient-e16bbc1fb2fa9d92aa79ffe4219854b9b12287ed.tar.xz |
Merge pull request #14 from corarona/master
lua-api: fix get/set_pitch
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_localplayer.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/script/lua_api/l_localplayer.cpp b/src/script/lua_api/l_localplayer.cpp index 8cd5d01e4..9b089458d 100644 --- a/src/script/lua_api/l_localplayer.cpp +++ b/src/script/lua_api/l_localplayer.cpp @@ -75,10 +75,8 @@ int LuaLocalPlayer::l_set_velocity(lua_State *L) int LuaLocalPlayer::l_get_yaw(lua_State *L) { - LocalPlayer *player = getobject(L, 1); - - lua_pushinteger(L, player->getYaw()); - return 1; + lua_pushnumber(L, wrapDegrees_0_360(g_game->cam_view.camera_yaw)); + return 1; } int LuaLocalPlayer::l_set_yaw(lua_State *L) @@ -97,13 +95,10 @@ int LuaLocalPlayer::l_set_yaw(lua_State *L) int LuaLocalPlayer::l_get_pitch(lua_State *L) { - LocalPlayer *player = getobject(L, 1); - - lua_pushinteger(L, player->getPitch()); - return 1; + lua_pushnumber(L, -wrapDegrees_180(g_game->cam_view.camera_pitch) ); + return 1; } - int LuaLocalPlayer::l_set_pitch(lua_State *L) { LocalPlayer *player = getobject(L, 1); |