diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-03-26 14:00:57 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-03-26 14:00:57 +0100 |
commit | 880c9768a9323800ca8d44cc4b73e92278e58743 (patch) | |
tree | cf5b0b340e7a02bff8e13ae364901b324114228b /src/server/luaentity_sao.cpp | |
parent | 83d09ffaf688aac9f2de67d06420572e4d0664dc (diff) | |
parent | 437d01196899f85bbc77d71123018aa26be337da (diff) | |
download | dragonfireclient-880c9768a9323800ca8d44cc4b73e92278e58743.tar.xz |
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/server/luaentity_sao.cpp')
-rw-r--r-- | src/server/luaentity_sao.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/server/luaentity_sao.cpp b/src/server/luaentity_sao.cpp index c7277491a..3bcbe107b 100644 --- a/src/server/luaentity_sao.cpp +++ b/src/server/luaentity_sao.cpp @@ -146,15 +146,11 @@ void LuaEntitySAO::step(float dtime, bool send_recommended) // Each frame, parent position is copied if the object is attached, otherwise it's calculated normally // If the object gets detached this comes into effect automatically from the last known origin - if(isAttached()) - { - v3f pos = m_env->getActiveObject(m_attachment_parent_id)->getBasePosition(); - m_base_position = pos; + if (auto *parent = getParent()) { + m_base_position = parent->getBasePosition(); m_velocity = v3f(0,0,0); m_acceleration = v3f(0,0,0); - } - else - { + } else { if(m_prop.physical){ aabb3f box = m_prop.collisionbox; box.MinEdge *= BS; @@ -492,6 +488,9 @@ void LuaEntitySAO::sendPosition(bool do_interpolate, bool is_movement_end) if(isAttached()) return; + // Send attachment updates instantly to the client prior updating position + sendOutdatedData(); + m_last_sent_move_precision = m_base_position.getDistanceFrom( m_last_sent_position); m_last_sent_position_timer = 0; |