View Single Post
08-19-08, 07:08 AM   #14
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
There's nothing illogical or "incorrect" about the results of the API IsSpellInRange. There are three logical evaluation results:

In Range = True
Not In Range = False
Not Applicable = Nil

A spell that has no range defined to it is going to return the third value. That spell has no need to have a range value because it is, in fact, not ranged. The API relates to ranged spells, so technically, you're the one using it incorrectly by querying non-ranged spells with a ranged evaluation API. You're luck you're getting a result at all, and not forcing a crash by using the API incorrectly.

Blizzard doesn't "expect" you to know what spells are ranged and what spells are not. However, they do "assume" that anyone taking the time to create UI AddOns has some understanding of the game and the concept behind the system they're designing their AddOn around. If you expect everything to be spoon-fed to you, then Blizzard would have to spend more time developing a fail-safe API system for "optional" AddOn authors rather than time developing what they're selling, which is a game.

So in recap, it's a RANGE TEST, and it doesn't FAIL because it returns an appropriate result for the data you feed it...that is...a NON-ranged spell.