Skip to content

Commit

Permalink
fix(Range): Unbreak item range finding
Browse files Browse the repository at this point in the history
  • Loading branch information
Cilraaz committed Dec 3, 2023
1 parent 1156a0b commit 13a806e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion HeroLib/Class/Unit/Range.lua
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ function Unit:IsInRangeByItem(Distance)
-- If the distance we want to check doesn't exists, we look for a fallback.
if not ItemRange[Distance] then
-- Iterate in reverse order the ranges in order to find the exact rannge or one that is lower than the one we look for (so we are guarantee it is in range)
local RangeIndex = Player:CanAttack(self) and RangeTable.HostileIndex or RangeTable.FriendlyIndex
local RangeIndex = RangeTable.RangeIndex
for i = #RangeIndex, 1, -1 do
local Range = RangeIndex[i]
if Range == Distance then break end
Expand Down

0 comments on commit 13a806e

Please sign in to comment.