WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoD Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=151)
-   -   SpellHasRange() and IsSpellInRange() sometimes not working (https://www.wowinterface.com/forums/showthread.php?t=49728)

Jarod24 08-17-14 09:20 AM

SpellHasRange() and IsSpellInRange() sometimes not working
 
I have tested SpellHasRange() and IsSpellInRange() on both the beta server (build 18716) and live servers.

Basically; if you use either SpellHasRange() or IsSpellInRange() for the spell "Ice lance" it will return nil on beta, but 0/1 as expected on live servers. I also tested this with frostbolt and frostfire bolt to compare.

I've only tested this on a lvl 100 mage on the Level 100 PvE server.
I do not know if other spells are bugged like this as well.
The spellID for "Ice Lance" is the same on live and beta servers (30455) and in it's tooltip is described as a spell with 40 yard range.


Live servers:
SpellHasRange("Frostbolt") -> 0 or 1
SpellHasRange("Frostfire Bolt") -> 0 or 1
SpellHasRange("Ice Lance") -> 0 or 1

IsSpellInRange ("Frostbolt","target") -> true or false
IsSpellInRange ("Frostfire Bolt","target") -> true or false
IsSpellInRange ("Ice Lance","target") -> true or false


Beta servers (build 18716)
SpellHasRange("Frostbolt") -> 0 or 1
SpellHasRange("Frostfire Bolt") -> 0 or 1
SpellHasRange("Ice Lance") -> nil

IsSpellInRange ("Frostbolt","target") -> true or false
IsSpellInRange ("Frostfire Bolt","target") -> true or false
IsSpellInRange ("Ice Lance","target") -> nil


and yes; the target was an hostile, attackable npc.

Duugu 08-17-14 10:23 AM

There's something wrong with the Ice Lance spell id on beta servers.

Dragging Ice Lance onto a action button with my lvl 90 mage on the beta server returns the the spell id 2136 - which according to wowhead is Fire Blast. (http://wod.wowhead.com/spell=2136)
But ... the icon texture is the Ice Lance icon (Interface\Icons\Spell_Frost_FrostBlast) and on click it casts Ice Lance.
GetSpellInfo(2136) returns the "Fire Blast" as name and "Interface\Icons\Spell_Frost_FrostBlast" as texture. oO

And IsSpellInRange(2136) does work as expected.

Strange :)


[e]
Where do you got the id 30455 from?

p3lim 08-17-14 10:34 AM

On the beta, more spells share the same ID, and the spell itself changes depending on specs.
This is very common for warlocks after they got revamped, they are just adding it to more spells for more classes.

Duugu 08-17-14 10:40 AM

Uhoh. Thanks p3lim. Was completely unaware of this.
Good to know. Has the potential to break stuff within my addon. :eek:

Cybeloras 08-18-14 03:06 PM

I wrote LibSpellRange-1.0 a while back for this exact purpose - IsSpellInRange() has been broken for a while. Servers are down right now on beta so I can't test it to be sure, but it should still work correctly.

http://wow.curseforge.com/addons/libspellrange-1-0/

It doesn't implement SpellHasRange() because, frankly, I never even knew that function existed since I never had a need for it. I'll look into implementing SpellHasRange as well.

Edit: It now also implements SpellHasRange as of r11.

Cybeloras 08-21-14 02:57 PM

It's also worth noting that IsSpellInRange() still returns 1/0/nil. IsItemInRange(), on the other hand, was updated to use true/false/nil.


All times are GMT -6. The time now is 11:22 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI