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.")
|
minetest.log("action", "matrix_bridge - signing out.")
|
||||||
end
|
end
|
||||||
|
|
||||||
local GLOBAL_STEPS = 0
|
local SECONDS = 0
|
||||||
minetest.register_globalstep(function(dtine)
|
minetest.register_globalstep(function(dtime)
|
||||||
-- print(GLOBAL_STEPS)
|
SECONDS = SECONDS + dtime
|
||||||
local GLOBAL_THRESHHOLD = 50
|
if SECONDS > 5 then
|
||||||
if GLOBAL_STEPS == GLOBAL_THRESHHOLD then
|
|
||||||
msync(since)
|
msync(since)
|
||||||
|
SECONDS = 0 -- reset
|
||||||
end
|
end
|
||||||
GLOBAL_STEPS = (GLOBAL_STEPS + 1) % (GLOBAL_THRESHHOLD+1)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_chatcommand("matrix", {
|
minetest.register_chatcommand("matrix", {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user