From d8689cfa2dce341c032caa9a5882946d8470ed23 Mon Sep 17 00:00:00 2001 From: autocommitter Date: Sun, 1 Dec 2024 00:00:02 +0100 Subject: State at 2024-12-01 --- durt/nodes/(-572,27,2515).lua | 2 +- durt/nodes/(1858,17,4242).lua | 26 ++++++++++++++++++++------ durt/nodes/(1864,17,4296).lua | 26 ++++++++++++++++++++------ 3 files changed, 41 insertions(+), 13 deletions(-) (limited to 'durt/nodes') 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 -- cgit v1.2.3