mirror of
https://github.com/minetest-mods/technic.git
synced 2025-02-23 07:10:19 +01:00
progressive lag adaption of technic_run execution interval
This commit is contained in:
parent
490c97faa9
commit
a5ce8c82b5
@ -58,9 +58,15 @@ minetest.register_globalstep(function(dtime)
|
|||||||
timer = 0
|
timer = 0
|
||||||
|
|
||||||
local max_lag = technic.get_max_lag()
|
local max_lag = technic.get_max_lag()
|
||||||
if max_lag > 1.5 then
|
-- slow down technic execution if the lag is higher than usual
|
||||||
-- slow down technic execution if the lag is higher than usual
|
if max_lag > 5.0 then
|
||||||
technic_run_interval = 1.5
|
technic_run_interval = 5.0
|
||||||
|
elseif max_lag > 2.0 then
|
||||||
|
technic_run_interval = 4.0
|
||||||
|
elseif max_lag > 1.5 then
|
||||||
|
technic_run_interval = 3.0
|
||||||
|
elseif max_lag > 1.0 then
|
||||||
|
technic_run_interval = 1.5
|
||||||
else
|
else
|
||||||
-- normal run_interval
|
-- normal run_interval
|
||||||
technic_run_interval = 1.0
|
technic_run_interval = 1.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user