Errors when opening buff assignments
LeighF51 opened this issue ยท 14 comments
When opening buff assignments on v1.4.4-classic on TBCC client I get the following error:
76x PallyPower\PallyPower-v1.4.4-classic.lua:641: attempt to perform arithmetic on field 'start' (a nil value)
[string "@PallyPower\PallyPower-v1.4.4-classic.lua"]:641: in function 'PallyPowerBlessingsGrid_Update'
[string "*:OnUpdate"]:1: in function <[string "*:OnUpdate"]:1>`
Locals:
self = PallyPowerBlessingsFrameTitle {
0 = <userdata>
}`
elapsed = 0.007000
numPallys = 0
numMaxClass = 1
(for generator) = <function> defined =[C]:-1
(for state) = <table> {
1 = "Zaresh"
}
(for control) = 1
i = 1
name = "Zaresh"
fname = "PallyPowerBlessingsFramePlayer1"
SkillInfo = <table> {
1 = <table> {
}
2 = <table> {
}
4 = <table> {
}
6 = <table> {
}
AuraInfo = <table> {
}
subgroup = 1
symbols = 0
CooldownInfo = <table> {
}
}
BuffInfo = <table> {
1 = 4
2 = 4
3 = 1
4 = 1
5 = 1
6 = 4
7 = 4
8 = 4
9 = 1
10 = 2
}
NormalBuffInfo = nil
AuraInfo = <table> {
1 = <table> {
}
2 = <table> {
}
6 = <table> {
}
}
aura = 1
CooldownInfo = <table> {
2 = <table> {
}
}
(for index) = 2
(for limit) = 2
(for step) = 1
id = 2
(*temporary) = <table> {
}
(*temporary) = <function> defined @PallyPower\PallyPower.lua:1947
(*temporary) = <table> {
CanControl = <function> defined @PallyPower\PallyPower.lua:1872
NormalBuffs = <table> {
}
modules = <table> {
}
CancelTimer = <function> defined @ElvUI\Libraries\Core\Ace\AceTimer-3.0\AceTimer-3.0.lua:147
AddRealmName = <function> defined @PallyPower\PallyPower.lua:1956
Skins = <table> {
}
ParseMessage = <function> defined @PallyPower\PallyPower.lua:1660
GetSpellID = <function> defined @PallyPower\PallyPower.lua:2964
SetDefaultModulePrototype = <function> defined @ElvUI\Libraries\Core\Ace\AceAddon-3.0\AceAddon-3.0.lua:409
AutoAssignAuras = <function> defined @PallyPower\PallyPower.lua:4161
player = "Zaresh"
BattleGroundTemplates = <table> {
}
IsEnabled = <function> defined @ElvUI\Libraries\Core\Ace\AceAddon-3.0\AceAddon-3.0.lua:451
IsAuraActive = <function> defined @PallyPower\PallyPower.lua:4091
ScheduleTimer = <function> defined @ElvUI\Libraries\Core\Ace\AceTimer-3.0\AceTimer-3.0.lua:94
AssignPlayerAsClass = <function> defined @PallyPower\PallyPower.lua:1044
GetClassID = <function> defined @PallyPower\PallyPower.lua:1972
AutoBuffedList = <table> {
}
RegisterMessage = <function> defined @ElvUI\Libraries\Core\Ace\CallbackHandler-1.0\CallbackHandler-1.0.lua:90
UnregisterMessage = <function> defined @ElvUI\Libraries\Core\Ace\CallbackHandler-1.0\CallbackHandler-1.0.lua:153
PerformAuraCycleBackwards = <function> defined @PallyPower\PallyPower.lua:4063
PerformCycleBackwards = <function> defined @PallyPower\PallyPower.lua:945
UpdateRoster = <function> defined @PallyPower\PallyPower.lua:1981
GetBuffExpiration = <function> defined @PallyPower\PallyPower.lua:2603
SetEnabledState = <function> defined @ElvUI\Libraries\Core\Ace\AceAddon-3.0\AceAddon-3.0.lua:424
ZONE_CHANGED_NEW_AREA = <function> defined @PallyPower\PallyPower.lua:1520
ScanCooldowns = <function> defined @PallyPower\PallyPower.lua:1296
GROUP_JOINED = <function> defined @PallyPower\PallyPower.lua:1538
ReportChannels = <function> defined @PallyPower\PallyPower.lua:759
OnEnable = <function> defined @PallyPower\PallyPower.lua:171
GROUP_LEFT = <function> defined @PallyPower\PallyPower.lua:1558
GetRFExpiration = <function> defined @PallyPower\PallyPower.lua:2659
OnInitialize = <function> defined @PallyPower\PallyPower.lua:84
UnregisterAllEvents = <function> defined @ElvUI\Libraries\Core\Ace\CallbackHandler-1.0\CallbackHandler-1.0.lua:174
isBCC = true
Templates = <table> {
}
PerformAuraCycle = <function> defined @PallyPower\PallyPower.lua:4030
optionsFrame = <unnamed> {
}
GetUnitAndSpellSmart = <function> defined @PallyPower\PallyPower.lua:2991
OnProfileChanged = <function> defined @PallyPower\PallyPower.lua:211
GetName = <function> defined @
This issue persists after uninstalling all addons, clearing Interface and WTF folders then installing and using PallyPower in isolation. It also still persists after uninstalling the game client and being the only addon installed on a fresh client
Comparing the error with the code it seems to be that the CooldownInfo is not populated on line 635 before it is accessed on 641 - I could be wrong though as I'm not familiar with lua or this codebase, I'm just trying to give as much info as I can to make investigation easier.
also just to check, can you do
/run PallyPower:ScanCooldowns()
before opening the blessing assignment screen?
unfortunately the provided error message does not indicate the actual error.
CooldownInfo should start as an empty table if it does not exist already (line 633)
and your debug says that it is indeed empty
line 637 evaluation thus should return false and the code within the true block should not execute
if you could, please add print statements to return values of relevant CooldownInfo values for debugging purposes
I placed a few print statements in to check where code was being evaluated:
The print out in game is as follows:
It looks like it is being set to something as it has a value (not sure what unless there is a way of printing a table to a console neatly?) I can also see in the bugsack dump that CooldownInfo appears twice once in SkillInfo as what seems like a blank table then again further down with a value CooldownInfo = <table> { 2 = <table> { } }
which to me looks like a table that has a blank table within it - could this be the culprit?
I also tried running /run PallyPower:ScanCooldowns() before opening assignments and had the same result, it didn't seem to do anything.
Please add printing of these values before the evaluation on line 640
if CooldownInfo[id].start ~= 0 and CooldownInfo[id].duration ~= 0 then
Perhaps we also need to check whether these are nil.
The display is supposed to show icons for LoH and DI if they are ready and a cooldown text if they are on cooldown, but it seems that something is not working right in ScanCooldowns
They are coming back as nil. I've also fixed the formatting on my original post that was cutting off the first line of the error where it states its trying to perform arithmetic on a nil value. That might have helped sooner, apologies for that!
I only have DI trained on my paladin not LoH and DI - could it be an issue with having one and not the other that causes the problem so they aren't set correctly as one is trained and the other isn't?
I only have DI trained on my paladin not LoH and DI - could it be an issue with having one and not the other that causes the problem so they aren't set correctly as one is trained and the other isn't?
That's likely the cause, but it needs to be handed by the addon in the ScanCooldowns function:
Need to add a flag on line 1308
CooldownInfo[cd].enabled = true
and modify line 637 to have a check for enabled flag
if CooldownInfo[id] and CooldownInfo[cd].enabled then
Should I train LoH and check the addon opens buff assignments? Would prove thats the cause
Tried it via code then via training the ability and its working fine both ways - cheers for the help!
I've created a lvl 1 character and a lvl 70 template character on BCC PTR and the error does not happen there at all.
Not sure what I'm missing with skills/talents to reproduce the error.
My paladin is 44 and I don't have any special setup to my talent build (https://tbc.wowhead.com/talent-calc/paladin/-0530513340000112521) but I only had Divine Intervention trained not Lay on Hands. Training one but not the other seemed to cause the issue. Training Lay on Hands (Rank 1) stopped the error from ocurring.
A level 1 character would naturally not have those skills available, does the lvl 70 template character have all the skills trained?
If SpellCooldowns[1]
(LoH) is nil
, ScanCooldowns
erroneously returns entirely. This causes SpellCooldowns[2]
(DI) to never be populated with data. The result is the reported error.