mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix(combatlog): accept extended TBC spell damage payloads
This commit is contained in:
parent
385ac1e66c
commit
5c8a2afa35
1 changed files with 2 additions and 6 deletions
|
|
@ -1472,11 +1472,12 @@ bool TbcPacketParsers::parseSpellDamageLog(network::Packet& packet, SpellDamageL
|
||||||
// targetGuid(8) + attackerGuid(8) + spellId(4) + damage(4) + schoolMask(1)
|
// targetGuid(8) + attackerGuid(8) + spellId(4) + damage(4) + schoolMask(1)
|
||||||
// + absorbed(4) + resisted(4) + periodicLog(1) + unused(1) + blocked(4) + flags(4)
|
// + absorbed(4) + resisted(4) + periodicLog(1) + unused(1) + blocked(4) + flags(4)
|
||||||
// = 43 bytes
|
// = 43 bytes
|
||||||
|
// Some servers append additional trailing fields; consume the canonical minimum
|
||||||
|
// and leave any extension bytes unread.
|
||||||
if (packet.getSize() - packet.getReadPos() < 43) return false;
|
if (packet.getSize() - packet.getReadPos() < 43) return false;
|
||||||
|
|
||||||
data = SpellDamageLogData{};
|
data = SpellDamageLogData{};
|
||||||
|
|
||||||
const size_t startPos = packet.getReadPos();
|
|
||||||
data.targetGuid = packet.readUInt64(); // full GUID in TBC
|
data.targetGuid = packet.readUInt64(); // full GUID in TBC
|
||||||
data.attackerGuid = packet.readUInt64(); // full GUID in TBC
|
data.attackerGuid = packet.readUInt64(); // full GUID in TBC
|
||||||
data.spellId = packet.readUInt32();
|
data.spellId = packet.readUInt32();
|
||||||
|
|
@ -1495,11 +1496,6 @@ bool TbcPacketParsers::parseSpellDamageLog(network::Packet& packet, SpellDamageL
|
||||||
// TBC does not have an overkill field here
|
// TBC does not have an overkill field here
|
||||||
data.overkill = 0;
|
data.overkill = 0;
|
||||||
|
|
||||||
if (packet.getReadPos() - startPos != 43) {
|
|
||||||
packet.setReadPos(startPos);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG_DEBUG("[TBC] Spell damage: spellId=", data.spellId, " dmg=", data.damage,
|
LOG_DEBUG("[TBC] Spell damage: spellId=", data.spellId, " dmg=", data.damage,
|
||||||
data.isCrit ? " CRIT" : "");
|
data.isCrit ? " CRIT" : "");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue