aboutsummaryrefslogtreecommitdiff
path: root/advtrains_line_automation/line_functions.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-06-23 23:06:44 +0200
committerorwell <orwell@bleipb.de>2025-06-23 23:09:15 +0200
commite04728f0424d4e42943fc187f295eb62a73bc5ce (patch)
tree99f6b82bc7bba4bbef5138e55b940d3a33bc4e2b /advtrains_line_automation/line_functions.lua
parent67511ec1f13023a402af69a4e5ce36c8503b344c (diff)
downloadadvtrains-e04728f0424d4e42943fc187f295eb62a73bc5ce.tar.gz
advtrains-e04728f0424d4e42943fc187f295eb62a73bc5ce.tar.bz2
advtrains-e04728f0424d4e42943fc187f295eb62a73bc5ce.zip
Get door closing time from wagon definition, no longer user configurable, and restore waitsig in stoprail atc command
Diffstat (limited to 'advtrains_line_automation/line_functions.lua')
-rw-r--r--advtrains_line_automation/line_functions.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/advtrains_line_automation/line_functions.lua b/advtrains_line_automation/line_functions.lua
index be2b29a..de5d133 100644
--- a/advtrains_line_automation/line_functions.lua
+++ b/advtrains_line_automation/line_functions.lua
@@ -769,9 +769,16 @@ function al.on_train_enter(pos, train_id, train, index)
end
-- ATC příkaz
- local atc_command = "B0 W O"..stdata.doors..(stdata.kick and "K" or "").." D"..wait..
- (stdata.keepopen and " " or " OC ")..(stdata.reverse and "R" or "").." D"..(stdata.ddelay or 1)..
- " A1 S" ..(stdata.speed or "M")
+ local trn_door_delay = math.ceil(train.door_operation_time or 1) -- must round to whole number
+ local atc_command = "B0 W O"..stdata.doors -- stop and open doors
+ ..(stdata.kick and "K" or "") -- potentially kick passengers out
+ ..(stdata.reverse and "R" or "") -- reverse if requested
+ .." D"..wait.." " -- wait for the requested time (TODO: replace this by a RWT scheduler at some point!)
+ .." A1 "..(stdata.waitsig and "G " or " ") -- enable ARS again and potentially wait for signal
+ ..(stdata.keepopen and "" or "OC") -- close doors, unless keepopen was set
+ .." D"..trn_door_delay -- wait for the door delay
+ .." S"..(stdata.speed or "M") -- depart with specified speed
+
advtrains.atc.train_set_command(train, atc_command, true)
-- provést změny vlaku