mirror of
https://github.com/Poikilos/mobs.git
synced 2023-10-03 07:28:50 -07:00
Fix dissapering of sheeps (lol, there were actually 2 bugs and didnt work at all before)
This commit is contained in:
parent
1633795ecd
commit
5e6374bf12
4
api.lua
4
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user