From d571d62863ca69a151f89175d9de3fe8397f9b79 Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Sun, 24 Jan 2021 17:47:28 -0600 Subject: [PATCH] Fix crash in 'mcl_spawn' in v6,flat,singlenode mapgens; and fix mobs despawning when attacking/following players. --- mods/ENTITIES/mcl_mobs/api.lua | 4 +++- mods/PLAYER/mcl_spawn/init.lua | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 895cad7253..821dbc0e90 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3604,7 +3604,9 @@ local mob_step = function(self, dtime) -- Despawning: when lifetimer expires, remove mob if remove_far 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 if self.despawn_immediately or self.lifetimer <= 0 then diff --git a/mods/PLAYER/mcl_spawn/init.lua b/mods/PLAYER/mcl_spawn/init.lua index eb6135bc9a..a3a461f7d2 100644 --- a/mods/PLAYER/mcl_spawn/init.lua +++ b/mods/PLAYER/mcl_spawn/init.lua @@ -425,7 +425,7 @@ end minetest.register_on_respawnplayer(mcl_spawn.spawn) function mcl_spawn.shadow_worker() - if #biome_ids < 1 then + if #biome_ids > 1 then for _, biome_name in pairs(biomes_white_list) do table.insert(biome_ids, minetest.get_biome_id(biome_name)) end