aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation
diff options
context:
space:
mode:
authorY. Wang <y5nw@protonmail.com>2025-10-04 21:25:43 +0000
committerorwell <orwell@bleipb.de>2026-01-29 21:54:50 +0100
commitbb2e1241b73bb6250f3fa1778525eb58501e22b5 (patch)
tree52c5201e333f9ed51e701c2d86204ca259c27036 /advtrains_luaautomation
parent862611d89b304c502dd600eed308eb4ad5fbf528 (diff)
Indicate routesetting trigger if a route is set
A player observed an issue with a certain setup where ARS is constantly triggered and the route cannot (easily) be canceled. This patch helps troubleshoot this issue by indicating the specific cause for routesetting (in particular, which train triggered ARS).
Diffstat (limited to 'advtrains_luaautomation')
-rw-r--r--advtrains_luaautomation/environment.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua
index 184d346..50eca7c 100644
--- a/advtrains_luaautomation/environment.lua
+++ b/advtrains_luaautomation/environment.lua
@@ -1,6 +1,8 @@
-------------
-- lua sandboxed environment
+local S = atlatc.translate
+
-- function to cross out functions and userdata.
-- modified from dump()
function atlatc.remove_invalid_data(o, nested)
@@ -218,7 +220,7 @@ if advtrains.interlocking then
end
static_env.set_route = function(signal, route_name)
local pos, sigd, tcbs, routeid, route = gen_checks(signal, route_name)
- return advtrains.interlocking.route.update_route(sigd, tcbs, routeid)
+ return advtrains.interlocking.route.update_route(sigd, tcbs, routeid, nil, S("LuaATC component"))
end
static_env.cancel_route = function(signal)
local pos, sigd, tcbs, routeid, route = gen_checks(signal, "", true)