From 41055d5abef92cea59e0989e4391ca207a84cdc4 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 7 Nov 2022 13:06:34 +0100 Subject: [PATCH] Check object on mob tranformation --- mods/CORE/mcl_util/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 0972e5019..4e8079df0 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -600,10 +600,12 @@ function mcl_util.get_object_name(object) end function mcl_util.replace_mob(obj, mob) + if not obj then return end local rot = obj:get_yaw() local pos = obj:get_pos() obj:remove() obj = minetest.add_entity(pos, mob) + if not obj then return end obj:set_yaw(rot) return obj end