From 2196999a442c79c4ac074d94e1593370260c27fb Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 5 Apr 2018 20:42:18 +0200 Subject: [PATCH] debuffs: fix tons of nil errors --- modules/debuffs.lua | 9 +++++---- pfUI.toc | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/debuffs.lua b/modules/debuffs.lua index b201fe1f..c99ffcc4 100644 --- a/modules/debuffs.lua +++ b/modules/debuffs.lua @@ -170,7 +170,7 @@ pfUI:RegisterModule("debuffs", function () function pfUI.debuffs:GetMaxRank(effect) local max = 0 - for id in pairs(effect) do + for id in pairs(L["debuffs"][effect]) do if id > max then max = id end end return max @@ -183,10 +183,11 @@ pfUI:RegisterModule("debuffs", function () if not pfUI.debuffs.objects[unit][unitlevel] then pfUI.debuffs.objects[unit][unitlevel] = {} end if not pfUI.debuffs.objects[unit][unitlevel][effect] then pfUI.debuffs.objects[unit][unitlevel][effect] = {} end - pfUI.debuffs.objects[unit][unitlevel][effect].old = {} pfUI.debuffs.objects[unit][unitlevel][effect].start = GetTime() pfUI.debuffs.objects[unit][unitlevel][effect].duration = duration or pfUI.debuffs:GetDuration(effect) + pfUI.debuffs.pending = {} + if pfUI.uf.target then pfUI.uf:RefreshUnit(pfUI.uf.target, "aura") end @@ -207,7 +208,7 @@ pfUI:RegisterModule("debuffs", function () if pfUI.debuffs.objects[unitname] and pfUI.debuffs.objects[unitname][unitlevel] and pfUI.debuffs.objects[unitname][unitlevel][effect] then -- clean up db - if pfUI.debuffs.objects[unitname][unitlevel][effect].duration + pfUI.debuffs.objects[unitname][unitlevel][effect].start < GetTime() then + if pfUI.debuffs.objects[unitname][unitlevel][effect].duration and pfUI.debuffs.objects[unitname][unitlevel][effect].duration + pfUI.debuffs.objects[unitname][unitlevel][effect].start < GetTime() then pfUI.debuffs.objects[unitname][unitlevel][effect] = nil return 0, 0, 0 end @@ -220,7 +221,7 @@ pfUI:RegisterModule("debuffs", function () -- no level data elseif pfUI.debuffs.objects[unitname] and pfUI.debuffs.objects[unitname][0] and pfUI.debuffs.objects[unitname][0][effect] then -- clean up db - if pfUI.debuffs.objects[unitname][0][effect].duration + pfUI.debuffs.objects[unitname][0][effect].start < GetTime() then + if pfUI.debuffs.objects[unitname][0][effect].duration and pfUI.debuffs.objects[unitname][0][effect].duration + pfUI.debuffs.objects[unitname][0][effect].start < GetTime() then pfUI.debuffs.objects[unitname][0][effect] = nil return 0, 0, 0 end diff --git a/pfUI.toc b/pfUI.toc index dab5ce2c..8f799971 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -2,7 +2,7 @@ ## Title: |cff33ffccpf|cffffffffUI ## Author: Shagu ## Notes: A complete user interface replacement. -## Version: 3.8.2 +## Version: 3.8.3 ## SavedVariables: pfUI_profiles, pfUI_gold ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB