diff options
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/api/ai_station.cpp | 4 | ||||
-rw-r--r-- | src/ai/api/ai_tile.cpp | 2 | ||||
-rw-r--r-- | src/ai/api/ai_waypoint.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_station.cpp b/src/ai/api/ai_station.cpp index 670355dff..5e25e5d8d 100644 --- a/src/ai/api/ai_station.cpp +++ b/src/ai/api/ai_station.cpp @@ -53,7 +53,7 @@ DEBUG(ai, 0, "GetCoverageRadius(): coverage radius of airports needs to be requested via AIAirport::GetAirportCoverageRadius(), as it requires AirportType"); return -1; } - if (CountBits(station_type) != 1) return -1; + if (!HasExactlyOneBit(station_type)) return -1; if (!_settings_game.station.modified_catchment) return CA_UNMODIFIED; switch (station_type) { @@ -89,7 +89,7 @@ /* static */ bool AIStation::HasStationType(StationID station_id, StationType station_type) { if (!IsValidStation(station_id)) return false; - if (CountBits(station_type) != 1) return false; + if (!HasExactlyOneBit(station_type)) return false; return (::Station::Get(station_id)->facilities & station_type) != 0; } diff --git a/src/ai/api/ai_tile.cpp b/src/ai/api/ai_tile.cpp index a90be1aa1..5ae15b83d 100644 --- a/src/ai/api/ai_tile.cpp +++ b/src/ai/api/ai_tile.cpp @@ -35,7 +35,7 @@ if (::GetRoadTypes(tile) != ROADTYPES_ROAD) return false; /* Depots and crossings aren't considered buildable */ if (::GetRoadTileType(tile) != ROAD_TILE_NORMAL) return false; - if (CountBits(::GetRoadBits(tile, ROADTYPE_ROAD)) != 1) return false; + if (!HasExactlyOneBit(::GetRoadBits(tile, ROADTYPE_ROAD))) return false; if (::IsRoadOwner(tile, ROADTYPE_ROAD, OWNER_TOWN)) return true; if (::IsRoadOwner(tile, ROADTYPE_ROAD, _current_company)) return true; return false; diff --git a/src/ai/api/ai_waypoint.cpp b/src/ai/api/ai_waypoint.cpp index f5badfbbb..a3845f89f 100644 --- a/src/ai/api/ai_waypoint.cpp +++ b/src/ai/api/ai_waypoint.cpp @@ -31,7 +31,7 @@ /* static */ bool AIWaypoint::HasWaypointType(StationID waypoint_id, WaypointType waypoint_type) { if (!IsValidWaypoint(waypoint_id)) return false; - if (CountBits(waypoint_type) != 1) return false; + if (!HasExactlyOneBit(waypoint_type)) return false; return (::Waypoint::Get(waypoint_id)->facilities & waypoint_type) != 0; } |