From 4d90dfab0e162cad395cde564dc8a2c11e8fcc7b Mon Sep 17 00:00:00 2001 From: bakawun Date: Fri, 1 Dec 2023 15:50:07 +0100 Subject: [PATCH] Spawning: add a comment to clarify what the random select is doing --- mods/ENTITIES/mcl_mobs/spawning.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index 5c58733e2..4108d038c 100755 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -980,7 +980,9 @@ if mobs_spawn then --output_mob_stats(mob_counts_wide) --grab mob that fits into the spawning location - --randomly grab a mob, don't exclude any possibilities + --use random weighted choice with replacement to grab a mob, don't exclude any possibilities + --shuffle table once every loop to provide equal inclusion probability to all mobs + --repeat grabbing a mob to maintain existing spawn rates local spawn_loop_counter = #mob_library_worker_table while spawn_loop_counter > 0 do