fix: add size check and skip WotLK guid suffix in handleCooldownEvent

SMSG_COOLDOWN_EVENT in WotLK appends an 8-byte unit guid after the spellId.
The handler was reading without a size check and not consuming the trailing
guid, which could misalign subsequent reads.
This commit is contained in:
Kelsi 2026-03-11 02:51:58 -07:00
parent 0a17683545
commit 603e52e5b0

View file

@ -13982,7 +13982,11 @@ void GameHandler::handleSpellCooldown(network::Packet& packet) {
}
void GameHandler::handleCooldownEvent(network::Packet& packet) {
if (packet.getSize() - packet.getReadPos() < 4) return;
uint32_t spellId = packet.readUInt32();
// WotLK appends the target unit guid (8 bytes) — skip it
if (packet.getSize() - packet.getReadPos() >= 8)
packet.readUInt64();
// Cooldown finished
spellCooldowns.erase(spellId);
for (auto& slot : actionBar) {