Skip to content

Commit

Permalink
Send attachments instantly before set_pos (#10235)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Feb 12, 2021
1 parent 4db7fb4 commit 375bcd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server.cpp
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions src/server/luaentity_sao.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 375bcd6

Please sign in to comment.