From 15be5006627f7ff1b81dc376ebf12ea7a0a7f86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Mon, 8 Jun 2020 13:42:24 +0200 Subject: document shunting mode, add unset_shunt to luaatc --- advtrains_luaautomation/README.txt | 4 ++++ advtrains_luaautomation/atc_rail.lua | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/advtrains_luaautomation/README.txt b/advtrains_luaautomation/README.txt index 20ef816..c377c1b 100644 --- a/advtrains_luaautomation/README.txt +++ b/advtrains_luaautomation/README.txt @@ -203,6 +203,10 @@ set_rc(routingcode) split_at_index(index, command) Splits the train at the specified index, into a train with index-1 wagons and a second train starting with the index-th wagon. command specifies an atc command to be sent to the second train after decoupling. +set_shunt() + Sets the train into shunting mode +unset_shunt() + Sets the train into normal mode # Operator panel This simple node executes its actions when punched. It can be used to change a switch and update the corresponding signals or similar applications. diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua index 1d94a2b..feac8d1 100644 --- a/advtrains_luaautomation/atc_rail.lua +++ b/advtrains_luaautomation/atc_rail.lua @@ -71,6 +71,10 @@ function r.fire_event(pos, evtdata) if not train_id then return false end train.is_shunt = true end, + unset_shunt = function() + if not train_id then return false end + train.is_shunt = nil + end, set_line = function(line) if type(line)~="string" and type(line)~="number" then return false -- cgit v1.2.3