
Originally Posted by
Morbid_Death
Inspect.Unit.Detail("player").chargeMax doesn't seem to be working anymore. Any ideas what it was changed to or why it quit working?
Thanks
Just wondering, have you changed from a mage spec that gives you additional charge to one that doesn't?
This is the code I use to calculate percentage charge:
Code:
return (unit.charge / (unit.chargeMax or 100)) * 100
This is because chargeMax is (and always has been as far as I know) null if it's 100.
I don't really like this tbh. It's the same with power, where there is no powerMax and no Event.Unit.Detail.PowerMax, because you can assume it's always 100. I'd prefer it if the API consistently presented this information in the same way. At some point, Trion may add a warrior talent that gives them +10 power, and we've all hard-coded 100 in our addons.
Bookmarks