Add mods: technic, moreores, paintings, Nyancat (Pbj_pup). Small fix: sandwiches
This commit is contained in:
parent
15e8e696a2
commit
fb09deddc1
1404 changed files with 156555 additions and 211 deletions
23
mods/technic_plus_beta/technic/max_lag.lua
Normal file
23
mods/technic_plus_beta/technic/max_lag.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
|
||||
local multiplier = technic.config:get_int("max_lag_reduction_multiplier")
|
||||
|
||||
local last_step = minetest.get_us_time()
|
||||
|
||||
local max_lag = 0
|
||||
|
||||
minetest.register_globalstep(function()
|
||||
-- Calculate own dtime as a workaround to 2 second limit
|
||||
local now = minetest.get_us_time()
|
||||
local dtime = now - last_step
|
||||
last_step = now
|
||||
|
||||
max_lag = max_lag * multiplier -- Decrease slowly
|
||||
|
||||
if dtime > max_lag then
|
||||
max_lag = dtime
|
||||
end
|
||||
end)
|
||||
|
||||
function technic.get_max_lag()
|
||||
return max_lag / 1000000
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue