View Single Post
08-10-14, 01:06 PM   #15
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by liquidbase View Post
with (maxXP == 0) the script throw a error if I want to display the value in a tooltip because of the nil-value.
If you're combining both mine and Torhal's conditions, there may be unexpected results depending on how you write it. It will need to look like this.
Code:
local percXP = (maxXP == 0) and 0 or math.floor((XP / maxXP) * 100)
Otherwise, I don't see how it's possible that a nil can pass through without throwing another error at this line.



If you post your entire code, we'll be able to help better and may catch problems that you might not see.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-10-14 at 01:35 PM.