From b2b63266b74dd3787687af3050ca6c210d19a180 Mon Sep 17 00:00:00 2001 From: bakawun Date: Fri, 1 Dec 2023 15:42:57 +0100 Subject: [PATCH] Spawning: break mob selection loop when out of bounds --- mods/ENTITIES/mcl_mobs/spawning.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index d6a9180df..5c58733e2 100755 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -995,12 +995,9 @@ if mobs_spawn then mob_chance = mob_library_worker_table[mob_index].chance step_chance = step_chance + mob_chance else - step_chance = 1000000 + break end end - if mob_index > #mob_library_worker_table then - mob_index = 1 - end --minetest.log(mob_def.name.." "..step_chance.. " "..mob_chance) local mob_def = mob_library_worker_table[mob_index]