mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
refactor: extract buildForceAck from 5 duplicated force-ACK blocks
All five force-ACK handlers (speed, root, flag, collision-height, knockback) repeated the same ~25-line GUID+counter+movementInfo+coord- conversion+send sequence. Extracted into buildForceAck() which returns a ready-to-send packet with the movement payload already written. This also fixes a transport coordinate conversion bug: the collision- height handler was the only one that omitted the ONTRANSPORT check, causing position desync when riding boats/zeppelins. buildForceAck handles transport coords uniformly for all callers. Net -80 lines.
This commit is contained in:
parent
5fcb30be1a
commit
7462fdd41f
2 changed files with 53 additions and 157 deletions
|
|
@ -179,6 +179,7 @@ private:
|
|||
void handleOtherPlayerMovement(network::Packet& packet);
|
||||
void handleMoveSetSpeed(network::Packet& packet);
|
||||
void handleForceRunSpeedChange(network::Packet& packet);
|
||||
network::Packet buildForceAck(Opcode ackOpcode, uint32_t counter);
|
||||
void handleForceSpeedChange(network::Packet& packet, const char* name, Opcode ackOpcode, float* speedStorage);
|
||||
void handleForceMoveRootState(network::Packet& packet, bool rooted);
|
||||
void handleMoveKnockBack(network::Packet& packet);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue