From c898e1e4db3b866ddc4ff391ff89798397775fbf Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sun, 25 Apr 2021 15:59:00 -0400 Subject: [PATCH 1/2] Update sheep.lua --- mods/ENTITIES/mobs_mc/sheep.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 3878a2558..5be276d8f 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -378,3 +378,4 @@ mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0) + From 7e3b69348e405425712cf8196907a913be10b62e Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sun, 25 Apr 2021 16:11:45 -0400 Subject: [PATCH 2/2] 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