From 8152314ba83b8f755d25bdc5a3c23b11c9e14649 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 10 Mar 2026 11:44:57 -0700 Subject: [PATCH] net: dispatch MSG_MOVE_SET_PITCH, GRAVITY_CHNG, UPDATE_CAN_FLY, UPDATE_CAN_TRANSITION_SWIM_FLY These four movement-broadcast opcodes (server relaying another player's movement packet) were not dispatched at all, causing nearby entity positions to be silently dropped for pitch changes and gravity/fly state broadcasts. Also add them to the kMoveOpcodes batch-parse table used by SMSG_COMPRESSED_MOVES, and parse SMSG_SPLINE_SET_FLIGHT/WALK/etc. speeds properly instead of consuming the whole packet. --- src/game/game_handler.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 0782e119..6dbec7aa 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -4481,6 +4481,10 @@ void GameHandler::handlePacket(network::Packet& packet) { case Opcode::MSG_MOVE_START_ASCEND: case Opcode::MSG_MOVE_STOP_ASCEND: case Opcode::MSG_MOVE_START_DESCEND: + case Opcode::MSG_MOVE_SET_PITCH: + case Opcode::MSG_MOVE_GRAVITY_CHNG: + case Opcode::MSG_MOVE_UPDATE_CAN_FLY: + case Opcode::MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY: if (state == WorldState::IN_WORLD) { handleOtherPlayerMovement(packet); } @@ -5159,9 +5163,15 @@ void GameHandler::handlePacket(network::Packet& packet) { case Opcode::SMSG_SPLINE_SET_SWIM_BACK_SPEED: case Opcode::SMSG_SPLINE_SET_WALK_SPEED: case Opcode::SMSG_SPLINE_SET_TURN_RATE: - case Opcode::SMSG_SPLINE_SET_PITCH_RATE: - packet.setReadPos(packet.getSize()); + case Opcode::SMSG_SPLINE_SET_PITCH_RATE: { + // Minimal parse: PackedGuid + float speed (no per-entity speed store yet) + if (packet.getSize() - packet.getReadPos() >= 5) { + (void)UpdateObjectParser::readPackedGuid(packet); + if (packet.getSize() - packet.getReadPos() >= 4) + (void)packet.readFloat(); + } break; + } // ---- Spline move flag changes for other units ---- case Opcode::SMSG_SPLINE_MOVE_UNROOT: @@ -12318,7 +12328,7 @@ void GameHandler::handleCompressedMoves(network::Packet& packet) { // Player movement sub-opcodes (SMSG_MULTIPLE_MOVES carries MSG_MOVE_*) // Not static — wireOpcode() depends on runtime active opcode table. - const std::array kMoveOpcodes = { + const std::array kMoveOpcodes = { wireOpcode(Opcode::MSG_MOVE_START_FORWARD), wireOpcode(Opcode::MSG_MOVE_START_BACKWARD), wireOpcode(Opcode::MSG_MOVE_STOP), @@ -12342,6 +12352,10 @@ void GameHandler::handleCompressedMoves(network::Packet& packet) { wireOpcode(Opcode::MSG_MOVE_START_ASCEND), wireOpcode(Opcode::MSG_MOVE_STOP_ASCEND), wireOpcode(Opcode::MSG_MOVE_START_DESCEND), + wireOpcode(Opcode::MSG_MOVE_SET_PITCH), + wireOpcode(Opcode::MSG_MOVE_GRAVITY_CHNG), + wireOpcode(Opcode::MSG_MOVE_UPDATE_CAN_FLY), + wireOpcode(Opcode::MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY), }; // Track unhandled sub-opcodes once per compressed packet (avoid log spam)