1
0
Fork 0

Spawning: break mob selection loop when out of bounds

patch_skins
bakawun 2023-12-01 15:42:57 +01:00
parent d151e79fb9
commit b2b63266b7
1 changed files with 1 additions and 4 deletions

View File

@ -995,12 +995,9 @@ if mobs_spawn then
mob_chance = mob_library_worker_table[mob_index].chance mob_chance = mob_library_worker_table[mob_index].chance
step_chance = step_chance + mob_chance step_chance = step_chance + mob_chance
else else
step_chance = 1000000 break
end end
end end
if mob_index > #mob_library_worker_table then
mob_index = 1
end
--minetest.log(mob_def.name.." "..step_chance.. " "..mob_chance) --minetest.log(mob_def.name.." "..step_chance.. " "..mob_chance)
local mob_def = mob_library_worker_table[mob_index] local mob_def = mob_library_worker_table[mob_index]