From 7e3b69348e405425712cf8196907a913be10b62e Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sun, 25 Apr 2021 16:11:45 -0400 Subject: [PATCH] Add secondary existence check after main logic has been executed to prevent future crashes --- mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index d144c9bc8..3fcc15fe5 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -1101,6 +1101,12 @@ mobs.mob_step = function(self, dtime) end end + --do not continue if non-existent + if not self or not self.object or not self.object:get_luaentity() then + self.object:remove() + return false + end + -- can mob be pushed, if so calculate direction -- do this last (overrides everything) if self.pushable then