From bb2e1241b73bb6250f3fa1778525eb58501e22b5 Mon Sep 17 00:00:00 2001 From: "Y. Wang" Date: Sat, 4 Oct 2025 21:25:43 +0000 Subject: 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). --- advtrains_luaautomation/environment.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'advtrains_luaautomation') 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) -- cgit v1.2.3