panel: fix division by zero in exp display

This commit is contained in:
greenya
2017-11-19 12:25:13 +01:00
committed by Shagu
parent 173a57ade5
commit ff060781b6
+6 -2
View File
@@ -220,8 +220,12 @@ pfUI:RegisterModule("panel", function ()
if oldexp ~= nil then
difexp = curexp - oldexp
maxexp = UnitXPMax("player")
remexp = floor((maxexp - curexp)/difexp)
remstring = "|cff555555 [" .. remexp .. "]|r"
if difexp > 0 then
remexp = floor((maxexp - curexp)/difexp)
remstring = "|cff555555 [" .. remexp .. "]|r"
else
remstring = nil
end
end
oldexp = curexp