Raven

2M Downloads

[Cata Classic] r680 Combat Bar Cancel Aura error

Road-block opened this issue ยท 3 comments

commented
2x Raven/Cancel.lua:125: attempt to call method 'CheckAuras' (a nil value)
[string "@Raven/Cancel.lua"]:125: in function <Raven/Cancel.lua:101>

Locals:
b = RavenOverlay4 {
 0 = <userdata>
 WrapScript = <function> defined @Blizzard_FrameXML/SecureHandlers.lua:782
 SetFrameRef = <function> defined @Blizzard_FrameXML/SecureHandlers.lua:793
 tooltipAnchor = "DEFAULT"
 Execute = <function> defined @Blizzard_FrameXML/SecureHandlers.lua:777
 aura_tt = "spell name"
 aura_id = "Lifebloom"
 UnwrapScript = <function> defined @Blizzard_FrameXML/SecureHandlers.lua:788
}
ttanchor = "DEFAULT"
(*temporary) = nil
(*temporary) = <table> {
 CheckTalent = <function> defined @Raven/Conditions.lua:335
 testOrder = <table> {
 }
 HexColor = <function> defined @Raven/Profile.lua:43
 UpdateInCombatBar = <function> defined @Raven/Cancel.lua:67
 modules = <table> {
 }
 Nest_SetShine = <function> defined @Raven/Nest.lua:1304
 GetValueFormat = <function> defined @Raven/Values.lua:833
 ReleaseBarGroup = <function> defined @Raven/Bars.lua:724
 CopyTable = <function> defined @Raven/Profile.lua:61
 ResetColorDefault = <function> defined @Raven/Profile.lua:480
 Nest_SetBarGroupLock = <function> defined @Raven/Nest.lua:974
 Nest_FormatTime = <function> defined @Raven/Nest.lua:1874
 SetInCombatBar = <function> defined @Raven/Cancel.lua:205
 LocalSpellNames = <table> {
 }
 GetExpireColor = <function> defined @Raven/Profile.lua:697
 UpdateInternalCooldowns = <function> defined @Raven/Main.lua:2182
 SetExpireColor = <function> defined @Raven/Profile.lua:685
 DefaultProfile = <table> {
 }
 ResetColorDefaults = <function> defined @Raven/Profile.lua:499
 RemoveMatchingTrackers = <function> defined @Raven/Main.lua:431
 Nest_CreateBar = <function> defined @Raven/Nest.lua:1075
 CheckSpec = <function> defined @Raven/Conditions.lua:390
 SetEnabledState = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:420
 FinalizeBars = <function> defined @Raven/Bars.lua:162
 mountSpells = <table> {
 }
 Nest_SetLabelColor = <function> defined @Raven/Nest.lua:1280
 LoadCustomBars = <function> defined @Raven/Bars.lua:529
 Nest_DeleteAllBars = <function> defined @Raven/Nest.lua:1244
 Nest_AdjustColor = <function> defined @Raven/Nest.lua:1345
 UpdateTrackers = <function> defined @Raven/Main.lua:1925
 ldbi = <table> {
 }
 Nest_RegisterCallbacks = <function> defined @Raven/Nest.lua:684
 UnregisterAllEvents = <function> defined @Ace3/CallbackHandler-1.0/CallbackHandler-1.0.lua:164
 InitializeBarGroup = <function> defined @Raven/Bars.lua:495
 Nest_SetBarGroupBorder = <function> defined @Raven/Nest.lua:899
 Nest_GetBarGroups = <function> defined @Raven/Nest.lua:797
 HideBars = <function> defined @Raven/Bars.lua:176
 OptionsPanel = <function> defined @Raven/Main.lua:1133
 Nest_SetBarGroupBackdrop = <function> defined @Raven/Nest.lua:907
 DetectInternalCooldown = <function> defined @Raven/Main.lua:2164
 Nest_SetColors = <function> defined @Raven/Nest.lua:1263
 isVanilla = false
 InitializeSpellIDs = <function> defined @Raven/Profile.lua:149
 GetName = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:275
 InitializeBuffTooltip = <function> defined @Raven/Main.lua:1473
 name = "Raven"
 ColorPalette = <table> {
 }
 SetConditionDefaults = <function> defined @Raven/Conditions.lua:869
 Nest_SetAlpha = <function> defined @Raven/Nest.lua:1295
 SaveBarGroupSettings = <function> defined @Raven/Bars.lua:526
 Print = <function> defined @Ace3/AceConsole-3.0/AceConsole-3.0.lua
commented

Hmm, I tried to fix it by adding this below local function CheckAuras(unit, auras, hasAll, isMine, buff, toggle) definition in Conditions.lua

MOD.CheckAuras = function(MOD, unit, auras, hasAll, isMine, buff, toggle)
	return CheckAuras(unit, auras, hasAll, isMine, buff, toggle)
end

Just to avoid searching for every instance of CheckAuras in that file and replacing with the exported version.

But the problem goes deeper than that. Cancel.lua calls MOD:CheckAuras("player", b.aura_id, true) but the function expects the 2nd argument to be a table.

Then I thought maybe Cancel.lua had a typo and meant to call MOD:CheckAura (not CheckAuras) but that also does not make sense as that method expects a name as second argument, so no idea what is supposed to happen.

Probably some refactoring happened that was left incomplete. ๐Ÿคท๐Ÿป

commented

Ok yeah after tracing a bit and reading code it is indeed a typo in Cancel.lua
Cancel.lua:125 is meant to be

local auraList = MOD:CheckAura("player", b.aura_id, true)

MOD:CheckAuras (extra 's')

commented

I'm rolling the correction out with r681, thanks for the report, the testing, and the fix!

Much appreciated ๐Ÿ˜Š