]> git.lizzy.rs Git - minetest.git/commitdiff
Send attachments instantly before set_pos (#10235)
authorSmallJoker <SmallJoker@users.noreply.github.com>
Fri, 12 Feb 2021 19:54:06 +0000 (20:54 +0100)
committerGitHub <noreply@github.com>
Fri, 12 Feb 2021 19:54:06 +0000 (20:54 +0100)
src/server.cpp
src/server/luaentity_sao.cpp

index af4eb17e25e1fd42398f51ef7b2259b2eb4c4f04..81cdd1f8d1ea6224d93cf66c5c944fe4efe58a1a 100644 (file)
@@ -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;
 
index c7277491af88b660dc831251d8d8d8073716e0c6..5f35aaed895c0999214ecfbc222f479f9902fcac 100644 (file)
@@ -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;