MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsPossibleCrossing

Function IsPossibleCrossing

src/road.cpp:45–51  ·  view source on GitHub ↗

* Return if the tile is a valid tile for a crossing. * * @param tile the current tile * @param ax the axis of the road over the rail * @return true if it is a valid tile */

Source from the content-addressed store, hash-verified

43 * @return true if it is a valid tile
44 */
45static bool IsPossibleCrossing(const TileIndex tile, Axis ax)
46{
47 return (IsTileType(tile, MP_RAILWAY) &&
48 GetRailTileType(tile) == RailTileType::Normal &&
49 GetTrackBits(tile) == (ax == AXIS_X ? TRACK_BIT_Y : TRACK_BIT_X) &&
50 std::get<0>(GetFoundationSlope(tile)) == SLOPE_FLAT);
51}
52
53/**
54 * Clean up unnecessary RoadBits of a planned tile.

Callers 1

CleanUpRoadBitsFunction · 0.85

Calls 4

IsTileTypeFunction · 0.85
GetRailTileTypeFunction · 0.85
GetTrackBitsFunction · 0.85
GetFoundationSlopeFunction · 0.85

Tested by

no test coverage detected