From d0d128c1d8f84e8de590e34adfe0265556ccd3e1 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 22 Apr 2021 18:18:57 -0400 Subject: [PATCH 1/2] Break infinite loop if unable to find any mob to spawn --- mods/ENTITIES/mcl_mobs/api/spawning.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api/spawning.lua b/mods/ENTITIES/mcl_mobs/api/spawning.lua index ed38ce25e..fe8a56dfc 100644 --- a/mods/ENTITIES/mcl_mobs/api/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/api/spawning.lua @@ -615,6 +615,12 @@ if mobs_spawn then local repeat_mob_search = true repeat + --do not infinite loop + if #mob_library_worker_table <= 0 then + --print("breaking infinite loop") + break + end + local skip = false --use this for removing table elements of mobs that do not match From 31a791c33b19d76350993d844747a0c51a77382c Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 22 Apr 2021 18:20:58 -0400 Subject: [PATCH 2/2] Undo debug.txt spam from mob spawning --- mods/ENTITIES/mcl_mobs/api/spawning.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/spawning.lua b/mods/ENTITIES/mcl_mobs/api/spawning.lua index fe8a56dfc..f885d55c7 100644 --- a/mods/ENTITIES/mcl_mobs/api/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/api/spawning.lua @@ -665,12 +665,12 @@ if mobs_spawn then --found a mob, exit out of loop if not skip then - minetest.log("warning", "found mob:"..temp_def.name) + --minetest.log("warning", "found mob:"..temp_def.name) --print("found mob:"..temp_def.name) mob_def = table_copy(temp_def) break else - minetest.log("warning", "deleting temp index "..temp_index) + --minetest.log("warning", "deleting temp index "..temp_index) --print("deleting temp index") table_remove(mob_library_worker_table, temp_index) end