From c1686923d36f3831a406151cd3e2ccba1ac94159 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 10 Jul 2022 12:16:19 +0200 Subject: [PATCH] Fix crash when no group spawning positions found --- mods/ENTITIES/mcl_mobs/spawning.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index a1c8e23b5f..e4988183d0 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -388,6 +388,10 @@ end local function spawn_group(p,mob,spawn_on,group_max) local nn = minetest.find_nodes_in_area(vector.offset(p,-3,-3,-3),vector.offset(p,3,3,3),spawn_on) + if not nn or #nn < 1 then + nn = {} + table.insert(nn,p) + end for i = 1, math.random(group_max) do minetest.add_entity(nn[math.random(#nn)],mob) end