mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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:
parent
0a17683545
commit
603e52e5b0
1 changed files with 4 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue