diff options
author | smatz <smatz@openttd.org> | 2010-02-05 17:05:58 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2010-02-05 17:05:58 +0000 |
commit | d62d0ac48997f9b72da0f554dcf5269694d5999e (patch) | |
tree | e849059133de10814a39a544a3060a9d7dcff672 /src/ai/api/ai_station.cpp | |
parent | a80eb0a1c00136ca3c4bbbe94842f386fdd2a334 (diff) | |
download | openttd-d62d0ac48997f9b72da0f554dcf5269694d5999e.tar.xz |
(svn r19019) -Codechange: use HasExactlyOneBit() and HasAtMostOneBit() instead of CountBits() where possible
Diffstat (limited to 'src/ai/api/ai_station.cpp')
-rw-r--r-- | src/ai/api/ai_station.cpp | 4 |
1 files changed, 2 insertions, 2 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; } |