From 98c195fb8eecb513f7576db1f07814e5bd432342 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 20:06:39 -0700 Subject: [PATCH] fix(combatlog): preserve spellsteal in dispel log handler --- src/game/game_handler.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index d9bc93c5..dc456389 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -6175,21 +6175,30 @@ void GameHandler::handlePacket(network::Packet& packet) { } // Show system message if player was victim or caster if (victimGuid == playerGuid || casterGuid == playerGuid) { - const char* verb = isStolen ? "stolen" : "dispelled"; if (!firstSpellName.empty()) { char buf[256]; - if (victimGuid == playerGuid && casterGuid != playerGuid) - std::snprintf(buf, sizeof(buf), "%s was %s.", firstSpellName.c_str(), verb); - else if (casterGuid == playerGuid) - std::snprintf(buf, sizeof(buf), "You %s %s.", verb, firstSpellName.c_str()); - else - std::snprintf(buf, sizeof(buf), "%s %s.", firstSpellName.c_str(), verb); + if (isStolen) { + if (victimGuid == playerGuid && casterGuid != playerGuid) + std::snprintf(buf, sizeof(buf), "%s was stolen.", firstSpellName.c_str()); + else if (casterGuid == playerGuid) + std::snprintf(buf, sizeof(buf), "You steal %s.", firstSpellName.c_str()); + else + std::snprintf(buf, sizeof(buf), "%s was stolen.", firstSpellName.c_str()); + } else { + if (victimGuid == playerGuid && casterGuid != playerGuid) + std::snprintf(buf, sizeof(buf), "%s was dispelled.", firstSpellName.c_str()); + else if (casterGuid == playerGuid) + std::snprintf(buf, sizeof(buf), "You dispel %s.", firstSpellName.c_str()); + else + std::snprintf(buf, sizeof(buf), "%s was dispelled.", firstSpellName.c_str()); + } addSystemChatMessage(buf); } - // Add dispel event to combat log + // Preserve stolen auras as spellsteal events so the log wording stays accurate. if (firstDispelledId != 0) { bool isPlayerCaster = (casterGuid == playerGuid); - addCombatText(CombatTextEntry::DISPEL, 0, firstDispelledId, isPlayerCaster, 0, + addCombatText(isStolen ? CombatTextEntry::STEAL : CombatTextEntry::DISPEL, + 0, firstDispelledId, isPlayerCaster, 0, casterGuid, victimGuid); } }