From 37350e81c94419003f14f2fde04aec8a7727941c Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Wed, 5 May 2021 12:52:07 -0400 Subject: [PATCH] Stop crashing when mob object is already deleted --- mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua index fd95b60ef..57cb6e4e5 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/death_logic.lua @@ -87,6 +87,12 @@ end mobs.death_logic = function(self, dtime) + + --stop crashing game when object is nil + if not self or not self.object or not self.object:get_luaentity() then + return + end + self.death_animation_timer = self.death_animation_timer + dtime --get all attached entities and sort through them