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

Function MayHaveRoad

src/road_map.cpp:21–36  ·  view source on GitHub ↗

* Test whether a tile can have road/tram types. * @param t Tile to query. * @return true if tile can be queried about road/tram types. */

Source from the content-addressed store, hash-verified

19 * @return true if tile can be queried about road/tram types.
20 */
21bool MayHaveRoad(Tile t)
22{
23 switch (GetTileType(t)) {
24 case MP_ROAD:
25 return true;
26
27 case MP_STATION:
28 return IsAnyRoadStop(t);
29
30 case MP_TUNNELBRIDGE:
31 return GetTunnelBridgeTransportType(t) == TRANSPORT_ROAD;
32
33 default:
34 return false;
35 }
36}
37
38/**
39 * Returns the RoadBits on an arbitrary tile

Callers 15

CmdBuildRoadWaypointFunction · 0.85
GetTrackTypesFunction · 0.85
GetRoadTypeRoadFunction · 0.85
GetRoadTypeTramFunction · 0.85
GetPresentRoadTypesFunction · 0.85
HasTileAnyRoadTypeFunction · 0.85
GetRoadOwnerFunction · 0.85
SetRoadTypeRoadFunction · 0.85
SetRoadTypeTramFunction · 0.85
CmdBuildRoadStopFunction · 0.85
GetAnyRoadBitsFunction · 0.85
RemoveRoadFunction · 0.85

Calls 3

GetTileTypeFunction · 0.85
IsAnyRoadStopFunction · 0.85

Tested by

no test coverage detected