1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-01-09 09:20:21 +01:00

mob hear nil check for player

This commit is contained in:
tenplus1 2024-09-14 07:51:06 +01:00
parent f1b5a66049
commit e55bf4d951

View File

@ -18,7 +18,7 @@ end
mobs = { mobs = {
mod = "redo", mod = "redo",
version = "20240908", version = "20240914",
spawning_mobs = {}, spawning_mobs = {},
translate = S, translate = S,
invis = minetest.global_exists("invisibility") and invisibility or {}, invis = minetest.global_exists("invisibility") and invisibility or {},
@ -4750,7 +4750,8 @@ if settings:get_bool("mobs_can_hear") ~= false then
elseif param.object then elseif param.object then
def.pos = param.object:get_pos() def.pos = param.object:get_pos()
elseif param.to_player then elseif param.to_player then
def.pos = minetest.get_player_by_name(param.to_player):get_pos() local player = minetest.get_player_by_name(param.to_player)
def.pos = player and player:get_pos()
end end
-- if no position found use default function -- if no position found use default function