Attmept to create the _current_combat.alternate_power if it no existant for some reason in Cataclysm classic

This commit is contained in:
Tercio Jose
2024-06-02 15:19:51 -03:00
parent 5cfb67f8db
commit bdf8901fa2
+8 -3
View File
@@ -3669,8 +3669,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
[SPELL_POWER_FURY] = {file = [[Interface\PLAYERFRAME\UI-PlayerFrame-Deathknight-Blood-On]], coords = {0, 1, 0, 1}},
}
local alternatePowerEnableFrame = CreateFrame("frame")
local alternatePowerMonitorFrame = CreateFrame("frame")
local alternatePowerEnableFrame = CreateFrame("frame", "DetailsAlternatePowerEventHandler")
local alternatePowerMonitorFrame = CreateFrame("frame", "DetailsAlternatePowerMonitor")
alternatePowerEnableFrame:RegisterEvent("UNIT_POWER_BAR_SHOW")
alternatePowerEnableFrame:RegisterEvent("ENCOUNTER_END")
alternatePowerEnableFrame.IsRunning = false
@@ -3691,7 +3691,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (powerType == "ALTERNATE") then
local actorName = Details:GetFullName(unitID)
if (actorName) then
local power = _current_combat.alternate_power[actorName]
--weird bug on cata as described below
if (not _current_combat.alternate_power) then
_current_combat.alternate_power = {}
end
local power = _current_combat.alternate_power[actorName] --cata: 120x Details/core/parser.lua:3694: attempt to index field 'alternate_power' (a nil value)
if (not power) then
power = _current_combat:CreateAlternatePowerTable(actorName)
end