Post
by silverj » Tue Mar 05, 2019 1:03 am
Actually, you chose inconsistently, some places they return data not present (C++ return false) to get a scripting NULL, while other places they return data present with a FALSE/0 value. This is not maintainability/readability/other excuse in my eyes - but of course it is not my code, so my eyes lie.
For example, AltAbilityTimer returns NULL/invalid while AltAbilityReady returns 0/not ready when indexed with an invalid index. Why? To me it looks like a bug, they are inconsistent when they should be consistent. But as I said, I will just work around them if you feel people have plenty of scripts out there that depend on these inconsistencies. Also as and additional commend, AbilityReady does return the NULL correctly, so you would also need to consider why that would differ from the rest of AbilityReady cases, if you feel this is not an inconsistency issue.
The ones I use that are not like AltAbilityTimer or AbilityReady (which are the right way from consistency perspective - you perform lookups in program order when indexing, maintaining outstanding indices until you find valid data, after which you will continue either evaluation or further indexing based on that valid data), and need to work around are: CombatAbilityReady, AltAbilityReady, ItemReady, SpellReady.