Quantcast
IsSpellInRange("Zeal","target") - WoWInterface
Thread Tools Display Modes
03-02-18, 05:32 PM   #1
doofus
A Flamescale Wyrmkin
Join Date: Feb 2018
Posts: 133
IsSpellInRange("Zeal","target")

I use the above code to determine if my target is in melee range. It works 99% of the time as intended. However there are situations / occasions where it returns nil and it's quite stubborn too, eg a reloadUI does not help. When I say "situations" I mean straight up one or more mobs, happily melee-ing them, but it returns nil. I am not sure what's up with it. Any ideas?
  Reply With Quote
03-02-18, 05:39 PM   #2
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 428
Try this.
Lua Code:
  1. local function InMeleeRange(unit)
  2.     local guid = UnitGUID(unit)
  3.     return guid and select(2, CanLootUnit(guid))
  4. end
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » IsSpellInRange("Zeal","target")

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off