From aa8df112ff42d94b6dc59a0153d989bd8c0b115e Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Wed, 27 Nov 2019 20:36:51 +0100 Subject: Attachments: Fix interpolation from (0,0,0) after detach GenericCAO::getPosition() did not take the camera offset into account LocalPlayer attachment cleanup: Use sane getParent() function Make that getPosition() (GenericCAO and LocalPlayer) always return the absolute position --- src/script/lua_api/l_localplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script/lua_api') diff --git a/src/script/lua_api/l_localplayer.cpp b/src/script/lua_api/l_localplayer.cpp index 3e14e48e4..821b1cb66 100644 --- a/src/script/lua_api/l_localplayer.cpp +++ b/src/script/lua_api/l_localplayer.cpp @@ -78,7 +78,7 @@ int LuaLocalPlayer::l_is_attached(lua_State *L) { LocalPlayer *player = getobject(L, 1); - lua_pushboolean(L, player->isAttached); + lua_pushboolean(L, player->getParent() != nullptr); return 1; } @@ -157,7 +157,7 @@ int LuaLocalPlayer::l_get_override_pos(lua_State *L) { LocalPlayer *player = getobject(L, 1); - push_v3f(L, player->overridePosition); + push_v3f(L, player->getPosition()); return 1; } -- cgit v1.2.3