summaryrefslogtreecommitdiff
path: root/durt/nodes/(-2080,3,827).lua
blob: 74778f454b311ca44839fdc597cc3d5908dae939 (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,830),"Headshunt")
atc_send("A1S2")