aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-01-23 13:14:40 +0100
committerorwell96 <orwell@bleipb.de>2018-01-23 13:14:40 +0100
commitc93a5bf39043651cf5b4ef486541d86644dc169f (patch)
treece2ef787e55842a2fea523eed8e96396859159fb
parent418c026038a21ba7c7ffaff7ec9f607b594670ef (diff)
downloadadvtrains-c93a5bf39043651cf5b4ef486541d86644dc169f.tar.gz
advtrains-c93a5bf39043651cf5b4ef486541d86644dc169f.tar.bz2
advtrains-c93a5bf39043651cf5b4ef486541d86644dc169f.zip
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 switched
-rw-r--r--advtrains/init.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua
index d5ef693..c1940ad 100644
--- a/advtrains/init.lua
+++ b/advtrains/init.lua
@@ -406,9 +406,8 @@ minetest.register_chatcommand("at_reroute",
privs = {train_operator=true}, -- Only train operator is required, since this is relatively safe.
func = function(name, param)
return advtrains.pcall(function()
- atwarn("Train routes will be recalculated now")
- advtrains.save(false)
- reload_saves()
+ advtrains.invalidate_all_paths()
+ return true, "Successfully invalidated train routes"
end)
end,
})