Initial minimal working tracerestrict implementation.
This is a port of the tracerestrict/routing restrictions feature from TTDPatch. At present this implements if tests (train length only), and pathfinder deny and penalty actions. This requires the use of YAPF. Note that restrictions are only evaluated within the YAPF lookahead distance.
This commit is contained in:
@@ -479,6 +479,18 @@ static inline bool HasOnewaySignalBlockingTrackdir(TileIndex tile, Trackdir td)
|
||||
!HasSignalOnTrackdir(tile, td) && IsOnewaySignal(tile, TrackdirToTrack(td));
|
||||
}
|
||||
|
||||
static inline bool IsRestrictedSignal(TileIndex t)
|
||||
{
|
||||
assert(GetRailTileType(t) == RAIL_TILE_SIGNALS);
|
||||
return (bool) GB(_m[t].m2, 12, 1);
|
||||
}
|
||||
|
||||
static inline void SetRestrictedSignal(TileIndex t, bool is_restricted)
|
||||
{
|
||||
assert(GetRailTileType(t) == RAIL_TILE_SIGNALS);
|
||||
SB(_m[t].m2, 12, 1, is_restricted);
|
||||
}
|
||||
|
||||
|
||||
RailType GetTileRailType(TileIndex tile);
|
||||
|
||||
|
Reference in New Issue
Block a user