1
0
mirror of https://github.com/mt-mods/biome_lib.git synced 2024-12-26 02:40:17 +01:00

don't bother checking dtime during globalstep

it's enough to rely in the run ratio.
This commit is contained in:
Vanessa Dannenberg 2021-04-06 10:00:16 -04:00
parent bef0a0d87e
commit 0ea4cb3848

View File

@ -481,17 +481,13 @@ end
-- "Play" them back, populating them with new stuff in the process -- "Play" them back, populating them with new stuff in the process
biome_lib.dtime_limit = tonumber(minetest.settings:get("biome_lib_dtime_limit")) or 0.5
local rr = tonumber(minetest.settings:get("biome_lib_queue_run_ratio")) or -100 local rr = tonumber(minetest.settings:get("biome_lib_queue_run_ratio")) or -100
biome_lib.queue_run_ratio = 100 - rr biome_lib.queue_run_ratio = 100 - rr
biome_lib.entries_per_step = math.max(-rr, 1) biome_lib.entries_per_step = math.max(-rr, 1)
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
if math.random(100) > biome_lib.queue_run_ratio if math.random(100) > biome_lib.queue_run_ratio then return end
or dtime > biome_lib.dtime_limit then
return
end
for s = 1, biome_lib.entries_per_step do for s = 1, biome_lib.entries_per_step do
biome_lib.generate_block() biome_lib.generate_block()
end end