@@ -15,7 +15,7 @@ local GetSpellInfo = Grid2.API.GetSpellInfo
1515local IsSpellInRange = Grid2 .API .IsSpellInRange
1616
1717---- ---------------------------------------------------------------------
18- -- Check Range Spells Info
18+ -- Range check spells initialization
1919---- ---------------------------------------------------------------------
2020local spellHostile , spellFriendly = nil , nil
2121do
@@ -82,6 +82,9 @@ local rezSpellID = ({DRUID=20484,PRIEST=2006,PALADIN=7328,SHAMAN=2008,MONK=11517
8282
8383local rezSpell = rezSpellID and GetSpellInfo (rezSpellID )
8484
85+ -- These range functions can be called before Grid2:UpdatePlayerRangeSpells() is executed because SPELLS_CHANGED
86+ -- event is executed after PLAYER_ENTERING_WORLD, it should not be a problem because those functions are checking
87+ -- if spellFriendly/spellHostile are not nil before calling IsSpellInRange()
8588local Ranges = {
8689 [99 ] = UnitIsVisible ,
8790 [38 ] = function (unit )
@@ -100,8 +103,12 @@ local Ranges = {
100103 return true
101104 elseif UnitCanAttack (' player' , unit ) then
102105 return spellHostile == nil or IsSpellInRange (spellHostile , unit ) == 1
106+ elseif rezSpell and UnitIsDeadOrGhost (unit ) then
107+ return IsSpellInRange (rezSpell , unit ) == 1
108+ elseif spellFriendly then
109+ return IsSpellInRange (spellFriendly , unit ) == 1
103110 else
104- return IsSpellInRange ( UnitIsDeadOrGhost ( unit ) and rezSpell or spellFriendly , unit ) == 1
111+ return InCombatLockdown () or CheckInteractDistance ( unit , 4 )
105112 end
106113 end ,
107114 [" spell" ] = function (unit )
0 commit comments