View Single Post
08-08-14, 05:36 PM   #1
liquidbase
A Warpwood Thunder Caller
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 97
Division by zero for XP

Hi @all

I use for my XP display the following lines:

Lua Code:
  1. local function GetPlayerXP()
  2.     return UnitXP("player"), UnitXPMax("player")
  3. end

and

Lua Code:
  1. local XP, maxXP = GetPlayerXP()
  2. local restXP = GetXPExhaustion()
  3. local percXP = math.floor((XP / maxXP) * 100)

The last line gives rise to the error mentioned in the thread title. The funny thing here is that I use the same script on the live server and it works there. Also on the Beta server, the correct values ​​are calculated and shown what you see on the screenshot below.

The error also occurs only at login and at each subsequent reload it exists not even. My question now is ... Do I have a mistake, I do not see the forest for the trees or Blizzard has an error return values​​?

Thanks in advance for all input.

greetz
liquid