forked from MineClone5/MineClone5
Fix mob despawn
This commit is contained in:
parent
7ad310a848
commit
21f7738b4d
|
@ -902,10 +902,14 @@ function mobs.mob_step(self, dtime)
|
||||||
object = self.object,
|
object = self.object,
|
||||||
max_hear_distance = 5
|
max_hear_distance = 5
|
||||||
}, true)
|
}, true)
|
||||||
self.object:punch(self.object, 1.0, {
|
--[[ if not mcl_burning.is_burning(self.object) then
|
||||||
full_punch_interval = 1.0,
|
mcl_burning.set_on_fire(self.object, 1.1)
|
||||||
damage_groups = {fleshy = self.lava_damage}
|
else
|
||||||
}, nil)
|
]] self.object:punch(self.object, 1.0, {
|
||||||
|
full_punch_interval = 1.0,
|
||||||
|
damage_groups = {fleshy = self.lava_damage}
|
||||||
|
}, nil)
|
||||||
|
-- end
|
||||||
self.lava_counter = 0
|
self.lava_counter = 0
|
||||||
self.health = self.health - lava_damage
|
self.health = self.health - lava_damage
|
||||||
self:teleport()
|
self:teleport()
|
||||||
|
|
|
@ -21,7 +21,7 @@ mobs.can_despawn = function(self)
|
||||||
if new_distance < distance then
|
if new_distance < distance then
|
||||||
distance = new_distance
|
distance = new_distance
|
||||||
if distance < 33 then return false end
|
if distance < 33 then return false end
|
||||||
if distance < 128 and math_random(1, 200) == 19 then return true end
|
if distance < 128 and math_random(1, 42) ~= 11 then return false end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue