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

Function HasAnyRoadTypesAvail

src/road.cpp:152–157  ·  view source on GitHub ↗

* Test if any buildable RoadType is available for a company. * @param company the company in question * @return true if company has any RoadTypes available */

Source from the content-addressed store, hash-verified

150 * @return true if company has any RoadTypes available
151 */
152bool HasAnyRoadTypesAvail(CompanyID company, RoadTramType rtt)
153{
154 RoadTypes avail = Company::Get(company)->avail_roadtypes;
155 avail.Reset(_roadtypes_hidden_mask);
156 return avail.Any(GetMaskForRoadTramType(rtt));
157}
158
159/**
160 * Validate functions for rail building.

Callers 1

Calls 3

GetMaskForRoadTramTypeFunction · 0.85
AnyMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected