From e2197753bcf9b530206617e40fb6a609ae67c958 Mon Sep 17 00:00:00 2001 From: Peldir Sunstrider <54337153+luhao007@users.noreply.github.com> Date: Wed, 9 Jun 2021 12:53:45 +0900 Subject: [PATCH] Fix DynamicOverallDamage's Tooltip Fix the issue that the Tooltip is double counting last combat when the combat is over. --- classes/class_custom.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/classes/class_custom.lua b/classes/class_custom.lua index 4f18f044..62ec6c71 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -2283,7 +2283,7 @@ desc = "Show overall damage done on the fly.", source = false, target = false, - script_version = 6, + script_version = 7, script = [[ --init: local combat, instance_container, instance = ... @@ -2353,12 +2353,14 @@ end --current - local player = CurrentCombat [1]:GetActor (actor.nome) - if (player) then - playerTotal = playerTotal + player.total - local playerSpells = player:GetSpellList() - for spellID, spellTable in pairs (playerSpells) do - AllSpells [spellID] = (AllSpells [spellID] or 0) + (spellTable.total or 0) + if (Details.in_combat) then + local player = CurrentCombat [1]:GetActor (actor.nome) + if (player) then + playerTotal = playerTotal + player.total + local playerSpells = player:GetSpellList() + for spellID, spellTable in pairs (playerSpells) do + AllSpells [spellID] = (AllSpells [spellID] or 0) + (spellTable.total or 0) + end end end