diff options
Diffstat (limited to 'durt/nodes/(1864,17,4296).lua')
-rw-r--r-- | durt/nodes/(1864,17,4296).lua | 26 |
1 files changed, 20 insertions, 6 deletions
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 |