Prevent server lag from compounding itself

This commit is contained in:
teknomunk 2024-03-20 06:39:23 +00:00
parent d8a7c4a189
commit 38d510d1e7
1 changed files with 3 additions and 0 deletions

View File

@ -1134,6 +1134,9 @@ if mobs_spawn then
while timer > WAIT_FOR_SPAWN_ATTEMPT do
initialize_spawn_data()
timer = timer - WAIT_FOR_SPAWN_ATTEMPT
if timer > WAIT_FOR_SPAWN_ATTEMPT * 20 then
timer = 0
end
local players = get_connected_players()
local total_mobs, total_non_hostile, total_hostile = count_mobs_total_cap()