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:
Kelsi 2026-02-23 05:13:26 -08:00
parent e98450f283
commit a58115041f

View file

@ -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) {