summaryrefslogtreecommitdiff
path: root/durt/nodes/(-2204,8,-651).lua
blob: 1607eaf3b8d4e8304c5ed435bf73214b5f367037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local cmd = {
	"TREES_RUNAROUND",
	"SHUNT_MAINLINE_REV",
}
__approach_callback_mode = 1

if event.approach and not event.has_entered then
	atc_set_ars_disable(true)
	atc_set_lzb_tsr(1)
	return
end

if event.train and atc_arrow then
	if not F.has_rc("BYARD_NOID_SHUTTLE") then return end -- not our train, disregard
	if not F.has_rc("TREES_RUNAROUND") then -- train has arrived from yard, split and runaround
		split_off_locomotive("A0B0") --disable ARS to stop the rest of the train engaging the signal
		F.add_rc(cmd) --add RC commands tomake the train runaround
		atc_send("S3A1") --send the loco on its way to make the runaround
		return
	end
	--else loco has returned from runaround
	F.remove_rc(cmd) -- remove runaround RCs
	atc_send("S0WRS1") --reverse the train and creep towards the other departure signal
	step_fc() --step the fc forward to be ready for the autoyard
	return
end