fixed typo on parameter and adjusted logic for interval
This commit is contained in:
parent
7a33519d77
commit
cfa2f41f1b
11
init.lua
11
init.lua
@ -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", {
|
||||
|
Loading…
x
Reference in New Issue
Block a user