Fix road/tram type check when moving depot orders to another depot

This commit is contained in:
Jonathan G Rennison
2022-06-25 18:24:32 +01:00
parent 21606df9d3
commit 85e949a6ba
2 changed files with 16 additions and 1 deletions

View File

@@ -205,6 +205,21 @@ static inline bool HasRoadTypeTram(TileIndex t)
return GetRoadTypeTram(t) != INVALID_ROADTYPE;
}
/**
* Get the present road types of a tile.
* @param t The tile to query.
* @return Present road types.
*/
static inline RoadTramTypes GetPresentRoadTramTypes(TileIndex t)
{
RoadTramTypes result = (RoadTramTypes)0;
if (MayHaveRoad(t)) {
if (GetRoadTypeRoad(t) != INVALID_ROADTYPE) result |= RTTB_ROAD;
if (GetRoadTypeTram(t) != INVALID_ROADTYPE) result |= RTTB_TRAM;
}
return result;
}
/**
* Check if a tile has a road or a tram road type.
* @param t The tile to check.