Skip to content

Commit

Permalink
fix(Range): Set minimum range check to 10y
Browse files Browse the repository at this point in the history
- If LibRangeCheck returns or lower as max range, we'll return true. Otherwise, Rogue range checking for all melee abilities is broken.
  • Loading branch information
Cilraaz committed Nov 16, 2023
1 parent 7671611 commit 95a4fbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HeroLib/Class/Unit/Range.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function Unit:IsInRange(Distance)
--IsInRange = IsItemInRange(ItemRange[Distance], self:ID())
local UnitMinRange, UnitMaxRange = LRC:GetRange(self:ID())
--HL.Print("IsInRange ("..tostring(self:Name())..") UnitMinRange: "..tostring(UnitMinRange)..", UnitMaxRange: "..tostring(UnitMaxRange))
IsInRange = UnitMaxRange and UnitMaxRange <= Distance
IsInRange = UnitMaxRange and (UnitMaxRange <= Distance or UnitMaxRange <= 10)
UnitInfoIsInRange[Identifier] = IsInRange
end

Expand Down Expand Up @@ -155,7 +155,7 @@ function Unit:IsInMeleeRange(Distance)

--return IsItemInRange(ItemRange[Distance], self:ID())
local UnitMinRange, UnitMaxRange = LRC:GetRange(self:ID())
return UnitMaxRange and UnitMaxRange <= Distance
return UnitMaxRange and (UnitMaxRange <= Distance or UnitMaxRange <= 10)
end

-- Get if the unit is in range, distance check through IsSpellInRange (works only for targeted spells only)
Expand Down

0 comments on commit 95a4fbb

Please sign in to comment.