bXP Error
I seem to be getting this error from the xp addon I'm using
Code:
bXP\bXP-1.0.lua:98: attempt to call global 'formatNumber' (a nil value) Here's the relevant code Code:
bar:SetScript("OnEvent", function() |
The code is trying to call the function formatNumber, which doesn't exist in the scope of that statement. Is this function defined anywhere in the AddOn?
|
only in that bit of code is it used.
|
The part of the function that handles rested XP appears to be using the format function to format its numbers, so you should probably use that for the non-rested part as well.
Is the format function defined by the AddOn or is it using the global alias of string.format? The latter would be pointless. |
I'm not too sure (not too good with lua), but I don't think it's defined by either.
Here's all the code. |
That code doesn't seem to be very well written, it's leaking quite a few globals.
You'll want to replace the calls to format and formatNumber with BreakUpLargeNumbers. You'll also want to replace IsXPUserDisabled == true with IsXPUserDisabled() (it's a function, not a boolean). I'm not sure why the code is using format with a single numeric argument unless it used to be something other than an alias of string.format (which I don't think is the case). |
Thank you, that seems to have fixed it. Yea, it's kind of an old (not updated) addon, but it does what I like.
|
All times are GMT -6. The time now is 11:51 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI