mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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:
parent
863ea742f6
commit
48d21f97bd
1 changed files with 11 additions and 6 deletions
|
|
@ -865,13 +865,18 @@ bool UpdateObjectParser::parseMovementBlock(network::Packet& packet, UpdateBlock
|
|||
}
|
||||
|
||||
// Swimming/flying pitch
|
||||
// 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.
|
||||
// WotLK 3.3.5a movement flags relevant here:
|
||||
// SWIMMING = 0x00200000
|
||||
// FLYING = 0x01000000 (player/creature actively flying)
|
||||
// SPLINE_ELEVATION = 0x02000000 (smooth vertical spline offset — no pitch field)
|
||||
// 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 */ ||
|
||||
(moveFlags & 0x02000000) /* FLYING(WotLK) */ ||
|
||||
(moveFlags & 0x01000000) /* FLYING */ ||
|
||||
(moveFlags2 & 0x0010) /* MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING */) {
|
||||
/*float pitch =*/ packet.readFloat();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue