summaryrefslogtreecommitdiff
path: root/Tyard/init_code.lua
blob: 91bf2b0c0f27dff988528dc8c5a735ab9ae292a1 (plain)
1
2
3
4
5
-- flag to hard enable RTS:
S.single_dir = true


F.EOL = function(direction,lane)
	if S.yard_active then
		if S.dir == direction then
			if atc_arrow then
				if not S.exiting then
				--return to PICKUP via headshunt
				split_off_locomotive("B0WR")
				set_rc("PICKUP")
				set_route("TY"..direction.."_"..lane, "HEADSHUNT")
				
				else
				--if S.exiting then loco has already sorted to correct lane for departure
				--S.exiting set by the pickup track
				set_rc(S.rc)
				set_route("TY"..direction.."_"..lane, "EXIT")
				S.exiting = nil
				end
			end
		else -- preparing for bi-directional. also EOL Bounce
			atc_send("B0WD1RS4")
		end
	end
end