mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 16:39:33 +01:00
Fix self object reference in player_in_active_range
This commit is contained in:
parent
32be8f9602
commit
af86e73280
1 changed files with 2 additions and 1 deletions
|
@ -47,7 +47,8 @@ end
|
|||
|
||||
function mob_class:player_in_active_range()
|
||||
for _,p in pairs(minetest.get_connected_players()) do
|
||||
if vector.distance(self.object:get_pos(),p:get_pos()) <= mob_active_range then return true end
|
||||
local pos = self.object:get_pos()
|
||||
if pos and vector.distance(pos, p:get_pos()) <= mob_active_range then return true end
|
||||
-- slightly larger than the mc 32 since mobs spawn on that circle and easily stand still immediately right after spawning.
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue