diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:57:00 +0200 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:57:00 +0200 |
commit | c5162349ed82ccbde82a8f870a45e7cc5c0c5e65 (patch) | |
tree | ebaa6c281c8f6c553590db4165fcff53a748943f /Tyard/nodes/(-4100,12,-2742).lua | |
parent | 10f12bff0f9191133e8c10c1754c5642e9b1f5b8 (diff) | |
download | luaatc_envs-c5162349ed82ccbde82a8f870a45e7cc5c0c5e65.tar.gz luaatc_envs-c5162349ed82ccbde82a8f870a45e7cc5c0c5e65.tar.bz2 luaatc_envs-c5162349ed82ccbde82a8f870a45e7cc5c0c5e65.zip |
State at 2022-04-23
Diffstat (limited to 'Tyard/nodes/(-4100,12,-2742).lua')
-rw-r--r-- | Tyard/nodes/(-4100,12,-2742).lua | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Tyard/nodes/(-4100,12,-2742).lua b/Tyard/nodes/(-4100,12,-2742).lua index 1fc57ae..37b303a 100644 --- a/Tyard/nodes/(-4100,12,-2742).lua +++ b/Tyard/nodes/(-4100,12,-2742).lua @@ -13,11 +13,23 @@ end if event.train then if not atc_arrow then --train has entered headshunt from yard. bounce or depart - if not F.has_rc("TY_DEPART") then --if has TY_DEPART then another controller closer to the signal will remove to ensure signal engages the RC - schedule_in(";01",atc_id) - atc_set_ars_disable(true) - return - end + atc_set_ars_disable(true) + F.remove_rc({"TY_HEADSHUNT"}) + if not F.has_rc("TY_FINAL_COLLECT") then + if not F.has_rc("TY_DEPART") then + schedule_in(";01",atc_id) + return + else + local collect = F.get_rc_safe():match("TY_COLLECT_(%S+)") + if collect then --train needs to collect a rake from the yard before departing + F.add_rc({"TY_FINAL_COLLECT","TY_CLASS_"..collect}) + schedule_in(";01",atc_id) + return + end + end + + --else let train proceed forward to the exit controller without a rake + end --else train has already collected rake. let it exit yard else --train has bounced if F.has_rc("TY_AROUND") then if this_dir == F.dir() then --send train to Classification @@ -28,7 +40,6 @@ if event.train then end --if at wrong end, do nothing. train will follow TY_AROUND ARS to relevant headshunt end -- if doesn't have TY_AROUND then let ARS classify the train - F.remove_rc({"TY_HEADSHUNT"}) atc_set_ars_disable(false) end return |