1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-11-13 05:50:17 +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 = {
mod = "redo",
version = "20240908",
version = "20240914",
spawning_mobs = {},
translate = S,
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
def.pos = param.object:get_pos()
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
-- if no position found use default function