mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix spline parsing always falling through to compact format
The legacy spline parser successfully read points but then unconditionally rewound and re-parsed as compact format. When the data was actually legacy format, the compact parser would read garbage and fail, causing the entire update block (and all subsequent blocks in the packet) to be dropped. This made creatures invisible when their spawn packet contained a spline.
This commit is contained in:
parent
e98450f283
commit
a58115041f
1 changed files with 3 additions and 3 deletions
|
|
@ -950,9 +950,8 @@ bool UpdateObjectParser::parseMovementBlock(network::Packet& packet, UpdateBlock
|
|||
/*float endPointX =*/ packet.readFloat();
|
||||
/*float endPointY =*/ packet.readFloat();
|
||||
/*float endPointZ =*/ packet.readFloat();
|
||||
LOG_DEBUG(" Spline pointCount=", pointCount);
|
||||
}
|
||||
|
||||
LOG_DEBUG(" Spline pointCount=", pointCount, " (legacy)");
|
||||
} else {
|
||||
// Legacy pointCount looks invalid; try compact WotLK layout as recovery.
|
||||
// This keeps malformed/variant packets from desyncing the whole update block.
|
||||
packet.setReadPos(legacyStart);
|
||||
|
|
@ -996,6 +995,7 @@ bool UpdateObjectParser::parseMovementBlock(network::Packet& packet, UpdateBlock
|
|||
if (!bytesAvailable(compactPayloadBytes)) return false;
|
||||
packet.setReadPos(packet.getReadPos() + compactPayloadBytes);
|
||||
}
|
||||
} // end else (compact fallback)
|
||||
}
|
||||
}
|
||||
else if (updateFlags & UPDATEFLAG_POSITION) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue