From 5e6374bf12d1168666c332981288e8746bac7d0d Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Fri, 31 May 2013 01:54:17 +0200 Subject: [PATCH] Fix dissapering of sheeps (lol, there were actually 2 bugs and didnt work at all before) --- api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index e77f917..d02fe63 100644 --- a/api.lua +++ b/api.lua @@ -117,7 +117,7 @@ function mobs:register_mob(name, def) end self.lifetimer = self.lifetimer - dtime - if self.lifetimer <= 0 and not tamed then + if self.lifetimer <= 0 and not self.tamed then local player_count = 0 for _,obj in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 20)) do if obj:is_player() then @@ -447,7 +447,7 @@ function mobs:register_mob(name, def) self.tamed = tmp.tamed end end - if self.lifetimer <= 0 then + if self.lifetimer <= 0 and not self.tamed then self.object:remove() end end,