From a212310913c33fb855ca0f262beda6d857382ff8 Mon Sep 17 00:00:00 2001 From: orwell Date: Tue, 28 Jan 2025 22:24:03 +0100 Subject: ATC: add "G" command to wait for green signal, improve ATC hud, potentially fix LZB issue --- advtrains/atc.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'advtrains/atc.lua') diff --git a/advtrains/atc.lua b/advtrains/atc.lua index b572cdc..8e54b08 100644 --- a/advtrains/atc.lua +++ b/advtrains/atc.lua @@ -94,6 +94,7 @@ function atc.train_reset_command(train, keep_tarvel) train.atc_brake_target=nil train.atc_wait_finish=nil train.atc_wait_autocouple=nil + train.atc_wait_signal=nil train.atc_arrow=nil if not keep_tarvel then train.tarvelocity=nil @@ -278,6 +279,10 @@ local matchptn={ train.atc_wait_autocouple=true return 3 end, + ["G"]=function(id, train) + train.atc_wait_signal=true + return 1 + end, } eval_conditional = function(command, arrow, speed) @@ -375,7 +380,8 @@ function atc.execute_atc_command(id, train) train.atc_command=string.sub(command, patlen+1) if train.atc_delay<=0 and not train.atc_wait_finish - and not train.atc_wait_autocouple then + and not train.atc_wait_autocouple + and not train.atc_wait_signal then --continue (recursive, cmds shouldn't get too long, and it's a end-recursion.) atc.execute_atc_command(id, train) end -- cgit v1.2.3