mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
fix(combatlog): parse proc log GUIDs in classic and tbc
This commit is contained in:
parent
f09913d6d2
commit
c5e7dde931
1 changed files with 12 additions and 5 deletions
|
|
@ -6306,15 +6306,22 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
break;
|
||||
}
|
||||
case Opcode::SMSG_SPELL_CHANCE_PROC_LOG: {
|
||||
// Format (all expansions): PackedGuid target + PackedGuid caster + uint32 spellId + ...
|
||||
if (packet.getSize() - packet.getReadPos() < 3) {
|
||||
// WotLK: packed_guid target + packed_guid caster + uint32 spellId + ...
|
||||
// TBC/Classic: uint64 target + uint64 caster + uint32 spellId + ...
|
||||
const bool procChanceTbcLike = isClassicLikeExpansion() || isActiveExpansion("tbc");
|
||||
auto readProcChanceGuid = [&]() -> uint64_t {
|
||||
if (procChanceTbcLike)
|
||||
return (packet.getSize() - packet.getReadPos() >= 8) ? packet.readUInt64() : 0;
|
||||
return UpdateObjectParser::readPackedGuid(packet);
|
||||
};
|
||||
if (packet.getSize() - packet.getReadPos() < (procChanceTbcLike ? 8u : 1u)) {
|
||||
packet.setReadPos(packet.getSize()); break;
|
||||
}
|
||||
uint64_t procTargetGuid = UpdateObjectParser::readPackedGuid(packet);
|
||||
if (packet.getSize() - packet.getReadPos() < 2) {
|
||||
uint64_t procTargetGuid = readProcChanceGuid();
|
||||
if (packet.getSize() - packet.getReadPos() < (procChanceTbcLike ? 8u : 1u)) {
|
||||
packet.setReadPos(packet.getSize()); break;
|
||||
}
|
||||
uint64_t procCasterGuid = UpdateObjectParser::readPackedGuid(packet);
|
||||
uint64_t procCasterGuid = readProcChanceGuid();
|
||||
if (packet.getSize() - packet.getReadPos() < 4) {
|
||||
packet.setReadPos(packet.getSize()); break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue