fix infinite range hook bug
This commit is contained in:
@@ -44,6 +44,8 @@ function Entity:checkNearest(type,maxdistance)
|
||||
local distance_y = entity.pos.y - self.pos.y
|
||||
local distance = math.sqrt(distance_x ^ 2 + distance_y ^ 2)
|
||||
|
||||
if maxdistance == "hook_specific" then maxdistance = entity.hook_distance end
|
||||
|
||||
if not maxdistance or distance < maxdistance then
|
||||
if shortest == -1 or distance < shortest then
|
||||
shortest = distance
|
||||
|
||||
Reference in New Issue
Block a user