Skip to content

Commit d27c561

Browse files
committed
Freeze issue and lua error fix
1 parent 25b0303 commit d27c561

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

Auras.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,21 @@ function MPOWA:GetCooldown(buff)
231231
end
232232

233233
function MPOWA:GetSpellSlot(buff)
234+
if not buff then
235+
return 0
236+
end
234237
local i = 1
235238
while true do
236239
local name, rank = GetSpellName(i, "spell")
237240
if (not name) or strfind(strlower(name), strlower(buff)) then
238241
return i
239242
end
243+
if i > 1000 then
244+
return 0 -- Lets give up at this point
245+
end
240246
i = i + 1
241247
end
248+
return 0
242249
end
243250

244251
local BuffExist = {}

GUI.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,15 +1065,15 @@ function MPOWA:OptionsFrame_SetColor()
10651065
frame.g = g
10661066
frame.b = b
10671067

1068-
self.SAVE[MPOWA.CurEdit][name.."_r"] = r
1069-
self.SAVE[MPOWA.CurEdit][name.."_g"] = g
1070-
self.SAVE[MPOWA.CurEdit][name.."_b"] = b
1068+
MPOWA.SAVE[MPOWA.CurEdit][name.."_r"] = r
1069+
MPOWA.SAVE[MPOWA.CurEdit][name.."_g"] = g
1070+
MPOWA.SAVE[MPOWA.CurEdit][name.."_b"] = b
10711071

10721072
if name == "fontcolor" then
1073-
if self.SAVE[MPOWA.CurEdit].usefontcolor then
1074-
_G("TextureFrame"..MPOWA.CurEdit.."_Timer"):SetTextColor(r,g,b,self.SAVE[MPOWA.CurEdit].fontalpha)
1073+
if MPOWA.SAVE[MPOWA.CurEdit].usefontcolor then
1074+
_G("TextureFrame"..MPOWA.CurEdit.."_Timer"):SetTextColor(r,g,b,MPOWA.SAVE[MPOWA.CurEdit].fontalpha)
10751075
else
1076-
_G("TextureFrame"..MPOWA.CurEdit.."_Timer"):SetTextColor(1,1,1,self.SAVE[MPOWA.CurEdit].fontalpha)
1076+
_G("TextureFrame"..MPOWA.CurEdit.."_Timer"):SetTextColor(1,1,1,MPOWA.SAVE[MPOWA.CurEdit].fontalpha)
10771077
end
10781078
elseif name == "icon" then
10791079
MPowa_ConfigFrame_Container_1_Icon_Texture:SetVertexColor(r,g,b)
@@ -1094,10 +1094,10 @@ function MPOWA:OptionsFrame_CancelColor()
10941094
frame.b = b
10951095

10961096
if name == "fontcolor" then
1097-
if self.SAVE[MPOWA.CurEdit].usefontcolor then
1098-
_G("TextureFrame"..MPOWA.CurEdit.."_Timer"):SetTextColor(r,g,b,self.SAVE[MPOWA.CurEdit].fontalpha)
1097+
if MPOWA.SAVE[MPOWA.CurEdit].usefontcolor then
1098+
_G("TextureFrame"..MPOWA.CurEdit.."_Timer"):SetTextColor(r,g,b,MPOWA.SAVE[MPOWA.CurEdit].fontalpha)
10991099
else
1100-
_G("TextureFrame"..MPOWA.CurEdit.."_Timer"):SetTextColor(1,1,1,self.SAVE[MPOWA.CurEdit].fontalpha)
1100+
_G("TextureFrame"..MPOWA.CurEdit.."_Timer"):SetTextColor(1,1,1,MPOWA.SAVE[MPOWA.CurEdit].fontalpha)
11011101
end
11021102
elseif name == "icon" then
11031103
MPowa_ConfigFrame_Container_1_Icon_Texture:SetVertexColor(r,g,b)

Init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CreateFrame("Frame", "MPOWA", UIParent)
2-
MPOWA.Build = 57
2+
MPOWA.Build = 58
33
MPOWA.Cloaded = false
44
MPOWA.loaded = false
55
MPOWA.selected = 1

0 commit comments

Comments
 (0)