From 3439df0333f232b73ff00d9654fd0c931302a163 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 10 Mar 2026 11:03:33 -0700 Subject: [PATCH] net: fix UPDATEFLAG_LIVING pitch misalignment for swimming entities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parseMovementBlock was checking moveFlags & 0x02000000 for the pitch field, but SWIMMING is 0x00200000 in WotLK 3.3.5a. Swimming NPCs and players in SMSG_UPDATE_OBJECT packets never triggered the pitch read, so the fallTime/jumpData/splineElevation fields were read from the wrong offsets, producing incorrect positions and orientations. Fix: check both SWIMMING (0x00200000) and FLYING (0x02000000), matching the WotLK format — same condition used in the write path. --- src/game/world_packets.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index 7587cd65..694a61cd 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -865,7 +865,14 @@ bool UpdateObjectParser::parseMovementBlock(network::Packet& packet, UpdateBlock } // Swimming/flying pitch - if ((moveFlags & 0x02000000) || (moveFlags2 & 0x0010)) { // MOVEMENTFLAG_SWIMMING or MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING + // WotLK 3.3.5a flags: SWIMMING=0x00200000, FLYING=0x02000000 + // Pitch is present when SWIMMING or FLYING are set, or MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING. + // The original check (0x02000000 only) missed SWIMMING, causing misaligned reads for + // swimming NPCs/players — all subsequent fields (fallTime, jumpData, splineElevation) + // would be read from the wrong offsets. + if ((moveFlags & 0x00200000) /* SWIMMING */ || + (moveFlags & 0x02000000) /* FLYING(WotLK) */ || + (moveFlags2 & 0x0010) /* MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING */) { /*float pitch =*/ packet.readFloat(); }