forked from VoxeLibre/VoxeLibre
Fix mobs despawning while close to player
This commit is contained in:
parent
0fe1707c2f
commit
9e97331bdc
|
@ -3598,15 +3598,15 @@ local mob_step = function(self, dtime)
|
||||||
for n = 1, #close_objs do
|
for n = 1, #close_objs do
|
||||||
if close_objs[n]:is_player() then
|
if close_objs[n]:is_player() then
|
||||||
self.lifetimer = 20
|
self.lifetimer = 20
|
||||||
else
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
if math.random(1, 10) <= 3 then
|
if math.random(1, 10) <= 3 then
|
||||||
minetest.log("action", "Mob "..self.name.." despawns in mob_step at "..minetest.pos_to_string(pos))
|
minetest.log("action", "Mob "..self.name.." despawns in mob_step at "..minetest.pos_to_string(pos))
|
||||||
mcl_burning.extinguish(self.object)
|
mcl_burning.extinguish(self.object)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
minetest.log("action", "Mob "..self.name.." despawns in mob_step at "..minetest.pos_to_string(pos))
|
minetest.log("action", "Mob "..self.name.." despawns in mob_step at "..minetest.pos_to_string(pos))
|
||||||
mcl_burning.extinguish(self.object)
|
mcl_burning.extinguish(self.object)
|
||||||
|
|
Loading…
Reference in New Issue