mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-30 20:03:00 +00:00
Fix crash in 'mcl_spawn' in v6,flat,singlenode mapgens; and fix mobs despawning when attacking/following players.
This commit is contained in:
parent
9b1b1504fd
commit
d571d62863
2 changed files with 4 additions and 2 deletions
|
@ -3604,7 +3604,9 @@ local mob_step = function(self, dtime)
|
||||||
-- Despawning: when lifetimer expires, remove mob
|
-- Despawning: when lifetimer expires, remove mob
|
||||||
if remove_far
|
if remove_far
|
||||||
and self.can_despawn == true
|
and self.can_despawn == true
|
||||||
and ((not self.nametag) or (self.nametag == "")) then
|
and ((not self.nametag) or (self.nametag == ""))
|
||||||
|
and self.state ~= "attack"
|
||||||
|
and self.following == nil then
|
||||||
|
|
||||||
self.lifetimer = self.lifetimer - dtime
|
self.lifetimer = self.lifetimer - dtime
|
||||||
if self.despawn_immediately or self.lifetimer <= 0 then
|
if self.despawn_immediately or self.lifetimer <= 0 then
|
||||||
|
|
|
@ -425,7 +425,7 @@ end
|
||||||
minetest.register_on_respawnplayer(mcl_spawn.spawn)
|
minetest.register_on_respawnplayer(mcl_spawn.spawn)
|
||||||
|
|
||||||
function mcl_spawn.shadow_worker()
|
function mcl_spawn.shadow_worker()
|
||||||
if #biome_ids < 1 then
|
if #biome_ids > 1 then
|
||||||
for _, biome_name in pairs(biomes_white_list) do
|
for _, biome_name in pairs(biomes_white_list) do
|
||||||
table.insert(biome_ids, minetest.get_biome_id(biome_name))
|
table.insert(biome_ids, minetest.get_biome_id(biome_name))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue