1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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
This commit is contained in:
SmallJoker 2019-11-27 20:36:51 +01:00 committed by SmallJoker
parent 51f230895c
commit aa8df112ff
7 changed files with 57 additions and 61 deletions

View file

@ -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;
}