Moved lag command to szutilpack
This commit is contained in:
parent
9cbb733097
commit
9e45f873ae
20
init.lua
20
init.lua
@ -303,23 +303,3 @@ register_cheat(
|
||||
if not fov then return false, err end
|
||||
player:set_properties({zoom_fov = fov})
|
||||
end)
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- SERVER LAG SIMULATOR
|
||||
|
||||
local lag = 0
|
||||
register_cheat(
|
||||
"lag",
|
||||
"Set artificial lag for the server, in seconds per step",
|
||||
"<seconds per step>",
|
||||
function(_, param)
|
||||
local num, err = numchk(param, 0, 1)
|
||||
if err then return false, err end
|
||||
lag = num
|
||||
end)
|
||||
local last = minetest.get_us_time()
|
||||
minetest.register_globalstep(function()
|
||||
local exp = last + lag * 1000000
|
||||
while minetest.get_us_time() < exp do end
|
||||
last = exp
|
||||
end)
|
||||
|
Loading…
x
Reference in New Issue
Block a user