diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2021-02-12 20:54:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-12 20:54:06 +0100 |
commit | 375bcd65c1903957e3a640cefffcc8df164b78bd (patch) | |
tree | 397a0faf2fe7eb994e8aecdb9650f26315bebf4e | |
parent | 4db7fb4a3be9de29460919ff2dc042e0812f31bd (diff) | |
download | minetest-375bcd65c1903957e3a640cefffcc8df164b78bd.tar.gz minetest-375bcd65c1903957e3a640cefffcc8df164b78bd.tar.bz2 minetest-375bcd65c1903957e3a640cefffcc8df164b78bd.zip |
Send attachments instantly before set_pos (#10235)
-rw-r--r-- | src/server.cpp | 3 | ||||
-rw-r--r-- | src/server/luaentity_sao.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp index af4eb17e2..81cdd1f8d 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1821,6 +1821,9 @@ void Server::SendMovePlayer(session_t peer_id) PlayerSAO *sao = player->getPlayerSAO(); assert(sao); + // Send attachment updates instantly to the client prior updating position + sao->sendOutdatedData(); + NetworkPacket pkt(TOCLIENT_MOVE_PLAYER, sizeof(v3f) + sizeof(f32) * 2, peer_id); pkt << sao->getBasePosition() << sao->getLookPitch() << sao->getRotation().Y; diff --git a/src/server/luaentity_sao.cpp b/src/server/luaentity_sao.cpp index c7277491a..5f35aaed8 100644 --- a/src/server/luaentity_sao.cpp +++ b/src/server/luaentity_sao.cpp @@ -492,6 +492,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; |