diff options
author | SmallJoker <mk939@ymail.com> | 2019-11-27 20:36:51 +0100 |
---|---|---|
committer | SmallJoker <SmallJoker@users.noreply.github.com> | 2019-12-07 15:12:26 +0100 |
commit | aa8df112ff42d94b6dc59a0153d989bd8c0b115e (patch) | |
tree | 3488aea2ccd10228740d810f9a34da2260c95a57 /src/script | |
parent | 51f230895c2b6d99a6fddc1c235140fcf9938742 (diff) | |
download | minetest-aa8df112ff42d94b6dc59a0153d989bd8c0b115e.tar.gz minetest-aa8df112ff42d94b6dc59a0153d989bd8c0b115e.tar.bz2 minetest-aa8df112ff42d94b6dc59a0153d989bd8c0b115e.zip |
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
Diffstat (limited to 'src/script')
-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 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; } |