diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-12-01 00:00:02 +0100 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-12-01 00:00:02 +0100 |
commit | d8689cfa2dce341c032caa9a5882946d8470ed23 (patch) | |
tree | 1b88b9255f587d2f691116fb2ef04ae6d8f6b918 /durt | |
parent | f891a64523b62aec180a7fbf0b7f0df1706affad (diff) | |
download | luaatc_envs-d8689cfa2dce341c032caa9a5882946d8470ed23.tar.gz luaatc_envs-d8689cfa2dce341c032caa9a5882946d8470ed23.tar.bz2 luaatc_envs-d8689cfa2dce341c032caa9a5882946d8470ed23.zip |
State at 2024-12-01
Diffstat (limited to 'durt')
-rw-r--r-- | durt/nodes/(-572,27,2515).lua | 2 | ||||
-rw-r--r-- | durt/nodes/(1858,17,4242).lua | 26 | ||||
-rw-r--r-- | durt/nodes/(1864,17,4296).lua | 26 |
3 files changed, 41 insertions, 13 deletions
diff --git a/durt/nodes/(-572,27,2515).lua b/durt/nodes/(-572,27,2515).lua index e84b01b..c658a14 100644 --- a/durt/nodes/(-572,27,2515).lua +++ b/durt/nodes/(-572,27,2515).lua @@ -1,2 +1,2 @@ -if event.puncher ~= "Maverick2797" then return end +-- if event.puncher ~= "Maverick2797" then return end interrupt_pos(POS(-630,26,2454), "notify")
\ No newline at end of file diff --git a/durt/nodes/(1858,17,4242).lua b/durt/nodes/(1858,17,4242).lua index 4f60fe8..44742c4 100644 --- a/durt/nodes/(1858,17,4242).lua +++ b/durt/nodes/(1858,17,4242).lua @@ -67,14 +67,28 @@ if event.schedule then if not F.has_rc("OAF_BRANCH_REVERSE_RECOUPLED") then if dir == "SHOVE" then -- loco first into platform, run around to shove out -- split_off_locomotive("S0OLA0",2) --ideally each pax wagon has a generic FC, but not likely as few people use them at all - split_at_index(2,"S0OLA0") - atc_send("S3") - F.add_rc(movelist[dir]) + if train_length() > 1 then + split_at_index(2,"S0OLA0") + atc_send("S3") + F.add_rc(movelist[dir]) + else + -- don't bother splitting, there's nothing to split anyway! + -- depart light (fallback) + F.add_rc("OAF_BRANCH_REVERSE_DONE") --triggers the ARS to depart + atc_send("SM") + print("DEPARTING LIGHT") + end else --dir == "HEAD" --shoved into platform, run around to put loco first F.add_rc(movelist[dir]) - split_at_index(train_length(),"S0WRA1S3") - F.remove_rc(movelist[dir]) - atc_send("S0WROR") + if train_length() > 1 then + split_at_index(train_length(),"S0WRA1S3") + F.remove_rc(movelist[dir]) + atc_send("S0WROR") + else --don't bother splitting, there's nothing to split anyway! + F.add_rc("OAF_BRANCH_REVERSE_DONE") --triggers the ARS to depart + atc_send("SM") + print("DEPARTING LIGHT") + end end print("SPLIT") return diff --git a/durt/nodes/(1864,17,4296).lua b/durt/nodes/(1864,17,4296).lua index b0f62d1..0136ea7 100644 --- a/durt/nodes/(1864,17,4296).lua +++ b/durt/nodes/(1864,17,4296).lua @@ -67,14 +67,28 @@ if event.schedule then if not F.has_rc("OAF_BRANCH_REVERSE_RECOUPLED") then if dir == "SHOVE" then -- loco first into platform, run around to shove out -- split_off_locomotive("S0OLA0",2) --ideally each pax wagon has a generic FC, but not likely as few people use them at all - split_at_index(2,"S0OLA0") - atc_send("S3") - F.add_rc(movelist[dir]) + if train_length() > 1 then + split_at_index(2,"S0OLA0") + atc_send("S3") + F.add_rc(movelist[dir]) + else + -- don't bother splitting, there's nothing to split anyway! + -- depart light (fallback) + F.add_rc("OAF_BRANCH_REVERSE_DONE") --triggers the ARS to depart + atc_send("SM") + print("DEPARTING LIGHT") + end else --dir == "HEAD" --shoved into platform, run around to put loco first F.add_rc(movelist[dir]) - split_at_index(train_length(),"S0WRA1S3") - F.remove_rc(movelist[dir]) - atc_send("S0WROR") + if train_length() > 1 then + split_at_index(train_length(),"S0WRA1S3") + F.remove_rc(movelist[dir]) + atc_send("S0WROR") + else --don't bother splitting, there's nothing to split anyway! + F.add_rc("OAF_BRANCH_REVERSE_DONE") --triggers the ARS to depart + atc_send("SM") + print("DEPARTING LIGHT") + end end print("SPLIT") return |