# HG changeset patch # User MMOSimca # Date 1759718887 14400 # Node ID 4a51fdc1e2e49f7550a7b8bc1434fa840be2f963 # Parent b15d966bf6ae76c4030ad6f956a0c146ea4cc761 Began the process of updating for Midnight's changes. diff -r b15d966bf6ae -r 4a51fdc1e2e4 Main.lua --- a/Main.lua Tue Aug 20 09:44:11 2024 -0400 +++ b/Main.lua Sun Oct 05 22:48:07 2025 -0400 @@ -19,6 +19,9 @@ local C_Spell = _G.C_Spell local GetCurrencyInfo = _G.GetCurrencyInfo +local ICL = InCombatLockdown +local III = IsInInstance + -- ADDON NAMESPACE ---------------------------------------------------- @@ -1219,15 +1222,19 @@ level_data = {} encounter_data[npc_level] = level_data end - level_data.max_health = level_data.max_health or _G.UnitHealthMax("target") - - -- May not capture as much data as it could, since the API changed in Legion to report multiple types of power - if not level_data.power then - local max_power = _G.UnitPowerMax("target") - - if max_power > 0 then - local power_type = _G.UnitPowerType("target") - level_data.power = ("%s:%d"):format(private.POWER_TYPE_NAMES[tostring(power_type)] or power_type, max_power) + + -- Can't do this in instances now + if not III() then + level_data.max_health = level_data.max_health or _G.UnitHealthMax("target") + + -- May not capture as much data as it could, since the API changed in Legion to report multiple types of power + if not level_data.power then + local max_power = _G.UnitPowerMax("target") + + if max_power > 0 then + local power_type = _G.UnitPowerType("target") + level_data.power = ("%s:%d"):format(private.POWER_TYPE_NAMES[tostring(power_type)] or power_type, max_power) + end end end name_to_id_map[_G.UnitName("target")] = unit_idnum