fixed typo on parameter and adjusted logic for interval

This commit is contained in:
- 2022-01-25 22:04:59 -08:00
parent 7a33519d77
commit cfa2f41f1b
1 changed files with 5 additions and 6 deletions

View File

@ -146,14 +146,13 @@ function mlogout ()
minetest.log("action", "matrix_bridge - signing out.")
end
local GLOBAL_STEPS = 0
minetest.register_globalstep(function(dtine)
-- print(GLOBAL_STEPS)
local GLOBAL_THRESHHOLD = 50
if GLOBAL_STEPS == GLOBAL_THRESHHOLD then
local SECONDS = 0
minetest.register_globalstep(function(dtime)
SECONDS = SECONDS + dtime
if SECONDS > 5 then
msync(since)
SECONDS = 0 -- reset
end
GLOBAL_STEPS = (GLOBAL_STEPS + 1) % (GLOBAL_THRESHHOLD+1)
end)
minetest.register_chatcommand("matrix", {