From 5911b8eb01f386b0a207f0d26f398fede6f6fbed Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 14 Mar 2026 09:36:42 -0700 Subject: [PATCH] fix(combatlog): show resisted amount from resist log packets --- src/game/game_handler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 138e3589..1774c003 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -7105,11 +7105,20 @@ void GameHandler::handlePacket(network::Packet& packet) { ? packet.readUInt64() : UpdateObjectParser::readPackedGuid(packet); if (rl_rem() < 4) { packet.setReadPos(packet.getSize()); break; } uint32_t spellId = packet.readUInt32(); + int32_t resistedAmount = 0; + // Resist payload includes: + // float resistFactor + uint32 targetResistance + uint32 resistedValue. + // Some servers may truncate optional tail fields, so parse defensively. + if (rl_rem() >= 12) { + /*float resistFactor =*/ packet.readFloat(); + /*uint32_t targetRes =*/ packet.readUInt32(); + resistedAmount = static_cast(packet.readUInt32()); + } // Show RESIST when the player is involved on either side. if (victimGuid == playerGuid) { - addCombatText(CombatTextEntry::RESIST, 0, spellId, false, 0, attackerGuid, victimGuid); + addCombatText(CombatTextEntry::RESIST, resistedAmount, spellId, false, 0, attackerGuid, victimGuid); } else if (attackerGuid == playerGuid) { - addCombatText(CombatTextEntry::RESIST, 0, spellId, true, 0, attackerGuid, victimGuid); + addCombatText(CombatTextEntry::RESIST, resistedAmount, spellId, true, 0, attackerGuid, victimGuid); } packet.setReadPos(packet.getSize()); break;