net: correct pitch condition to use FLYING=0x01000000 not SPLINE_ELEVATION=0x02000000

The previous fix added SWIMMING (0x00200000) correctly but kept 0x02000000
which is SPLINE_ELEVATION (smooth vertical spline offset), not the FLYING
flag. WotLK 3.3.5a FLYING = 0x01000000; pitch should be read when SWIMMING
or FLYING are active. This corrects the condition and updates the comment.
This commit is contained in:
Kelsi 2026-03-10 11:16:40 -07:00
parent 863ea742f6
commit 48d21f97bd

View file

@ -865,13 +865,18 @@ bool UpdateObjectParser::parseMovementBlock(network::Packet& packet, UpdateBlock
} }
// Swimming/flying pitch // Swimming/flying pitch
// WotLK 3.3.5a flags: SWIMMING=0x00200000, FLYING=0x02000000 // WotLK 3.3.5a movement flags relevant here:
// Pitch is present when SWIMMING or FLYING are set, or MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING. // SWIMMING = 0x00200000
// The original check (0x02000000 only) missed SWIMMING, causing misaligned reads for // FLYING = 0x01000000 (player/creature actively flying)
// swimming NPCs/players — all subsequent fields (fallTime, jumpData, splineElevation) // SPLINE_ELEVATION = 0x02000000 (smooth vertical spline offset — no pitch field)
// would be read from the wrong offsets. // MovementFlags2:
// MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING = 0x0010
//
// Pitch is present when SWIMMING or FLYING are set, or the always-allow flag is set.
// The original code checked 0x02000000 (SPLINE_ELEVATION) which neither covers SWIMMING
// nor FLYING, causing misaligned reads for swimming/flying entities in SMSG_UPDATE_OBJECT.
if ((moveFlags & 0x00200000) /* SWIMMING */ || if ((moveFlags & 0x00200000) /* SWIMMING */ ||
(moveFlags & 0x02000000) /* FLYING(WotLK) */ || (moveFlags & 0x01000000) /* FLYING */ ||
(moveFlags2 & 0x0010) /* MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING */) { (moveFlags2 & 0x0010) /* MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING */) {
/*float pitch =*/ packet.readFloat(); /*float pitch =*/ packet.readFloat();
} }