summaryrefslogtreecommitdiff
path: root/durt/nodes/(-2080,3,822).lua
blob: c9d875ff51f844e02c317e61719a2c02c5d574d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
if not event.train then return end --not sure why we'd need anythign else, but just in case
if not atc_arrow then return end --not used in this case
if not F.has_rc("ARC_LOAD") then return end --not the train for this runaround

if not F.has_rc("ARC_LOAD_RUNAROUND") then --train has arrived from yard. split and runaround
	split_off_locomotive("A0B0",1)
	F.add_rc({
		"ARC_LOAD_RUNAROUND", --runaround flag
		"ARC_LOAD_HS_N",
		"ARC_LOAD_AROUND", -- actual RC to send through runaround
		"ARC_LOAD_HS_S",
		"ARC_LOAD_HS_S_AC"
	})
else --loco has rejoined from runaround. push through to headshunt, run over loading tracks and prepare for departure
	F.remove_rc("ARC_LOAD_AROUND")
	F.add_rc({
		"ARC_LOAD_HS_N",
		"ARC_LOAD_LOADING",
		"ARC_AUTO"
	})
end
set_route(POS(-2081,4,825),"Headshunt")
atc_send("A1S2")