Skip to content

Commit

Permalink
Retail: Added a Phased check to range status.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnpsp committed Feb 6, 2021
1 parent 0d08747 commit 7fc3efc
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions modules/StatusRange.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local tostring = tostring
local UnitIsUnit = UnitIsUnit
local UnitInRange = UnitInRange
local IsSpellInRange = IsSpellInRange
local UnitPhaseReason = UnitPhaseReason
local UnitIsDeadOrGhost = UnitIsDeadOrGhost
local CheckInteractDistance = CheckInteractDistance

Expand Down Expand Up @@ -45,11 +46,23 @@ end
local rezSpell = ({DRUID=20484,PRIEST=2006,PALADIN=7328,SHAMAN=2008,MONK=115178,DEATHKNIGHT=61999,WARLOCK=20707})[playerClass]
if rezSpell then
rezSpell = GetSpellInfo(rezSpell)
UnitIsInRange = function(unit)
if UnitIsDeadOrGhost(unit) then
return UnitIsUnit(unit,"player") or IsSpellInRange(rezSpell,unit) == 1
else
return UnitRangeCheck(unit)
if Grid2.isClassic then -- classic check
UnitIsInRange = function(unit)
if UnitIsDeadOrGhost(unit) then
return UnitIsUnit(unit,"player") or IsSpellInRange(rezSpell,unit) == 1
else
return UnitRangeCheck(unit)
end
end
else -- retail check
UnitIsInRange = function(unit)
if UnitPhaseReason(unit) then
return
elseif UnitIsDeadOrGhost(unit) then
return UnitIsUnit(unit,"player") or IsSpellInRange(rezSpell,unit) == 1
else
return UnitRangeCheck(unit)
end
end
end
end
Expand Down

0 comments on commit 7fc3efc

Please sign in to comment.