From cc5a0971ac18f90e01b27d343af0bb727c91cc28 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Mon, 5 Jun 2023 15:03:45 +0100 Subject: [PATCH] Object reference check before setting velocity --- mods/ENTITIES/mobs_mc/sheep.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index bc5026bd2..6c095fc9b 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -125,8 +125,8 @@ mcl_mobs.register_mob("mobs_mc:sheep", { self:set_animation("eat") self:set_velocity(0) minetest.after(self.replace_delay, function() - self.object:set_velocity(vector.zero()) if self and self.object and self.object:get_velocity() and self.health > 0 then + self.object:set_velocity(vector.zero()) if not self.color or not colors[self.color] then self.color = "unicolor_white" end