Use shunt for combined shunt/normal for routes into a bay with shunt exit
This commit is contained in:
@@ -1565,8 +1565,36 @@ void DetermineCombineNormalShuntModeWithLookahead(Train *v, TileIndex tile, Trac
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* end of line */
|
/* end of line, see if this is a bay with a shunt signal on the exit */
|
||||||
return;
|
TileIndex t = v->lookahead->reservation_end_tile;
|
||||||
|
Trackdir td = ReverseTrackdir(v->lookahead->reservation_end_trackdir);
|
||||||
|
while (true) {
|
||||||
|
if (t == tile) {
|
||||||
|
/* Reached this signal, don't follow any further */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (IsTunnelBridgeWithSignalSimulation(t)) return;
|
||||||
|
|
||||||
|
if (IsTileType(t, MP_RAILWAY) && HasSignalOnTrackdir(t, td)) {
|
||||||
|
/* Found first signal on exit from bay where reservation ends */
|
||||||
|
if (HasBit(_signal_style_masks.next_only, GetSignalStyle(t, TrackdirToTrack(td)))) {
|
||||||
|
/* Shunt signal, use shunt route */
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
/* Use normal route */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ft.Follow(t, td)) {
|
||||||
|
TrackdirBits bits = ft.m_new_td_bits & TrackBitsToTrackdirBits(GetReservedTrackbits(ft.m_new_tile));
|
||||||
|
if (!HasExactlyOneBit(bits)) return;
|
||||||
|
|
||||||
|
t = ft.m_new_tile;
|
||||||
|
td = FindFirstTrackdir(bits);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* shunt mode */
|
/* shunt mode */
|
||||||
|
Reference in New Issue
Block a user