summaryrefslogtreecommitdiff
path: root/Hyard/nodes/(-2594,12,-1780).lua
blob: 7a257dba5e7c1de04b0ad566d98227dcda22fba7 (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
28

local dir = 1
local lane = 6
if S.dir == dir and atc_arrow then
   set_route("HYD"..lane, "HEADSHUNT1")
   local plen = train_length()
   local rc = split_at_fc("B0")
   local trc = "HY"..rc..dir
   S.cars = plen - train_length()
   if plen == train_length() and (rc == "" or S.rc:match(trc)) and not (S.rc:match("HYREVERSE")) then
       S.exiting = true
   end
   if rc and rc ~= "" then
       set_rc("HY"..rc..dir)
   else
          set_rc(S.rc)
          S.exiting = true
   end  
elseif S.dir == 2 and atc_arrow then
if S.rc:match("HYREVERSE")  and S.cars == 0 then
   set_route("HYD"..lane, "HEADSHUNT1")
S.reversing = true
S.dir = 1
end
if not S.reversing then
atc_send("B0WD1RS4")
end
end