0
0
Fork 0

Rename detect_players_in_area to detect_closest_player_within_radius

This commit is contained in:
jordan4ibanez 2021-04-20 16:46:10 -04:00
parent ac08c6991c
commit 348df0fcec
2 changed files with 2 additions and 2 deletions

View File

@ -600,7 +600,7 @@ mobs.mob_step = function(self, dtime)
--true for line_of_sight is debug
--10 for radius is debug
--1 for eye height adjust is debug
local attacking = mobs.detect_players_in_area(self,true,10,1)
local attacking = mobs.detect_closest_player_within_radius(self,true,10,1)
if attacking then
print(attacking:get_player_name())

View File

@ -14,7 +14,7 @@ local do_tnt = function(obj, damage)
end
--a fast function to be able to detect only players without using objects_in_radius
mobs.detect_players_in_area = function(self, line_of_sight, radius, object_height_adder)
mobs.detect_closest_player_within_radius = function(self, line_of_sight, radius, object_height_adder)
line_of_sight = line_of_sight or true --fallback line_of_sight
radius = radius or 10 -- fallback radius