diff options
author | glx <glx@openttd.org> | 2007-10-05 22:13:35 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2007-10-05 22:13:35 +0000 |
commit | 8e5480aa1697c1e86308a898875b37324dc4200b (patch) | |
tree | b5b767bc7b9c9aa3ef1f2fe1aa876ed2fd8bfebe /src/aircraft.h | |
parent | 0fd7d6257bfe72dcac6b78adee0ac3f83b0d4724 (diff) | |
download | openttd-8e5480aa1697c1e86308a898875b37324dc4200b.tar.xz |
(svn r11214) -Fix [FS#1296]: planes can't use heliports so refuse these orders
Diffstat (limited to 'src/aircraft.h')
-rw-r--r-- | src/aircraft.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/aircraft.h b/src/aircraft.h index bd274f3a9..25dd586ea 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -33,20 +33,29 @@ static inline bool IsNormalAircraft(const Vehicle *v) return v->subtype <= AIR_AIRCRAFT; } -/** Checks if an aircraft is buildable at the tile in question +/** Checks if an aircraft can use the station in question * @param engine The engine to test - * @param tile The tile where the hangar is - * @return true if the aircraft can be build + * @param st The station + * @return true if the aircraft can use the station */ -static inline bool IsAircraftBuildableAtStation(EngineID engine, TileIndex tile) +static inline bool CanAircraftUseStation(EngineID engine, const Station *st) { - const Station *st = GetStationByTile(tile); const AirportFTAClass *apc = st->Airport(); const AircraftVehicleInfo *avi = AircraftVehInfo(engine); return (apc->flags & (avi->subtype & AIR_CTOL ? AirportFTAClass::AIRPLANES : AirportFTAClass::HELICOPTERS)) != 0; } +/** Checks if an aircraft can use the station at the tile in question + * @param engine The engine to test + * @param tile The tile where the station is + * @return true if the aircraft can use the station + */ +static inline bool CanAircraftUseStation(EngineID engine, TileIndex tile) +{ + return CanAircraftUseStation(engine, GetStationByTile(tile)); +} + /** * Calculates cargo capacity based on an aircraft's passenger * and mail capacities. |