From 5575fc6f28ec28ceefefcf82446913c71668ce81 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 14 Mar 2026 09:29:02 -0700 Subject: [PATCH] fix(combatlog): preserve unknown source for environmental entries --- src/game/game_handler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 16374768..138e3589 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -14381,8 +14381,11 @@ void GameHandler::addCombatText(CombatTextEntry::Type type, int32_t amount, uint log.spellId = spellId; log.isPlayerSource = isPlayerSource; log.timestamp = std::time(nullptr); + // If the caller provided an explicit destination GUID but left source GUID as 0, + // preserve "unknown/no source" (e.g. environmental damage) instead of + // backfilling from current target. uint64_t effectiveSrc = (srcGuid != 0) ? srcGuid - : (isPlayerSource ? playerGuid : targetGuid); + : ((dstGuid != 0) ? 0 : (isPlayerSource ? playerGuid : targetGuid)); uint64_t effectiveDst = (dstGuid != 0) ? dstGuid : (isPlayerSource ? targetGuid : playerGuid); log.sourceName = lookupName(effectiveSrc);