Simplify /at_reroute
It is not necessary to reload the save files, because there already is a function to invalidate train routes e.g. when turnouts are switchedmaster
parent
418c026038
commit
c93a5bf390
|
@ -406,9 +406,8 @@ minetest.register_chatcommand("at_reroute",
|
||||||
privs = {train_operator=true}, -- Only train operator is required, since this is relatively safe.
|
privs = {train_operator=true}, -- Only train operator is required, since this is relatively safe.
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
return advtrains.pcall(function()
|
return advtrains.pcall(function()
|
||||||
atwarn("Train routes will be recalculated now")
|
advtrains.invalidate_all_paths()
|
||||||
advtrains.save(false)
|
return true, "Successfully invalidated train routes"
|
||||||
reload_saves()
|
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue