Riftui

Riftui (https://www.riftui.com/forums/index.php)
-   Lua Help (https://www.riftui.com/forums/forumdisplay.php?f=16)
-   -   error: attempt to call compare number with nill (https://www.riftui.com/forums/showthread.php?t=763)

Tsukiyo 06-21-13 12:21 PM

error: attempt to call compare number with nill
 
I'm trying to remake an addon, but came across something I can't solve on my own it seems.

So the addon tracks ability cooldowns and it actually works, except for the GCD's showing up and the icon of the first ability that got used after logging being stuck on the bar.

Now I've check some other addons and they used the following code to prevent GCD from showing up:

Code:

if ((ability.cooldown ~= nil) and
                (ability.currentCooldown <= ability.cooldown + 0.0001) and
                (ability.currentCooldown >= ability.cooldown - 0.0001)) then

When I try that I get "attempt to compare number with nill". I'm pretty sure this is fairly simple, but I'm just overlooking it :/

Any help would be appreciated :)


EDIT1: I saw the API changed and made ability.currentCooldown into ability.currentCooldownDuration. That fixed the error but I got a new one now.

"attempt to index global "ability' ( a nil value)"

Tsukiyo 06-21-13 01:17 PM

Fixed - I'm retarded :>


All times are GMT -6. The time now is 11:37 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2020 MMOUI