summaryrefslogtreecommitdiff
path: root/durt/nodes/(-736,3,1857).lua
blob: b40529e98835945ff5bd2679a2e22fc9748ce63c (plain)
1
mainline_rc = "autorun FREIGHT"
mainline_ln = "Maverick2797_diamonds"
function speed_check()
	if atc_speed > 0 then
		interrupt(1,"speed_check")
		return
	else
		interrupt(1,"split_train")
		return
	end
end

if event.train then
	if atc_arrow then
		if get_rc()=="split_around" then
			if atc_speed > 0 then
				speed_check()
			end
			return
		else
			set_rc(mainline_rc)
			set_line(mainline_ln)
			set_route("icebreaker_shunt1","return to factory")
			atc_send("S3")
			return
		end
		return
	end
	return
end

if event.int then
	if event.message == "speed_check" then speed_check() end
	if event.message=="split_train" then
		atc_send("S0")
		split_at_index(2,"")
		set_route("icebreaker_shunt1","split->headhunt")
		atc_send("S3")
		return
	end
	return
end