Add chatcommand and luaatc function to get global_slowdown

This commit is contained in:
orwell 2024-02-06 23:06:38 +01:00
parent 9fac1db45f
commit 2ea4a8cff1
2 changed files with 13 additions and 0 deletions

View File

@ -758,6 +758,16 @@ minetest.register_chatcommand("at_disable_step",
end,
})
minetest.register_chatcommand("at_status",
{
params = "",
description = "Print advtrains status info",
privs = {train_operator = true},
func = function(name, param)
return true, advtrains.print_concat_table({"Advtrains Status: no_action",no_action,"slowdown",advtrains.global_slowdown,"(log",math.log(advtrains.global_slowdown),")"})
end,
})
advtrains.is_no_action = function()
return no_action
end

View File

@ -164,6 +164,9 @@ local static_env = {
return false
end
end,
get_slowdown = function()
return advtrains.global_slowdown
end
}
-- If interlocking is present, enable route setting functions