From 23023dc140c8c101b5f94228f99e023be0f3e955 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 19:36:42 -0700 Subject: [PATCH] fix(combatlog): keep spell-go miss metadata --- src/game/game_handler.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index b49e8c66..c5dff0ef 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -16862,8 +16862,9 @@ void GameHandler::handleSpellGo(network::Packet& packet) { // Clear unit cast bar when the spell lands (for any tracked unit) unitCastStates_.erase(data.casterUnit); - // Show miss/dodge/parry/etc combat text when player's spells miss targets - if (data.casterUnit == playerGuid && !data.missTargets.empty()) { + // Preserve spellId and actual participants for spell-go miss results. + // This keeps the persistent combat log aligned with the later GUID fixes. + if (!data.missTargets.empty()) { static const CombatTextEntry::Type missTypes[] = { CombatTextEntry::MISS, // 0=MISS CombatTextEntry::DODGE, // 1=DODGE @@ -16875,10 +16876,15 @@ void GameHandler::handleSpellGo(network::Packet& packet) { CombatTextEntry::ABSORB, // 7=ABSORB CombatTextEntry::RESIST, // 8=RESIST }; - // Show text for each miss (usually just 1 target per spell go) + const uint64_t spellCasterGuid = data.casterUnit != 0 ? data.casterUnit : data.casterGuid; + const bool playerIsCaster = (spellCasterGuid == playerGuid); + for (const auto& m : data.missTargets) { + if (!playerIsCaster && m.targetGuid != playerGuid) { + continue; + } CombatTextEntry::Type ct = (m.missType < 9) ? missTypes[m.missType] : CombatTextEntry::MISS; - addCombatText(ct, 0, 0, true); + addCombatText(ct, 0, data.spellId, playerIsCaster, 0, spellCasterGuid, m.targetGuid); } }