From 5231f5669dcb1f4caa641696a16c8517239a5303 Mon Sep 17 00:00:00 2001 From: tron Date: Thu, 15 Feb 2007 20:16:33 +0000 Subject: (svn r8747) -Fix -Codechange: Make the encoding of accepted aircraft types of airports a bit more sensible and move the enum into struct AirportFTAClass --- src/aircraft_cmd.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/aircraft_cmd.cpp') diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index b84a2c276..2108cadc3 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -250,7 +250,7 @@ int32 CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) // Prevent building aircraft types at places which can't handle them const Station* st = GetStationByTile(tile); const AirportFTAClass* apc = GetAirport(st->airport_type); - if ((avi->subtype & AIR_CTOL ? HELICOPTERS_ONLY : AIRCRAFT_ONLY) == apc->acc_planes) { + if (!(apc->flags & (avi->subtype & AIR_CTOL ? AirportFTAClass::PLANES : AirportFTAClass::HELICOPTERS))) { return CMD_ERROR; } @@ -1636,12 +1636,8 @@ static void AircraftEventHandler_Flying(Vehicle *v, const AirportFTAClass *apc) uint16 tcur_speed, tsubspeed; st = GetStation(v->u.air.targetairport); - // flying device is accepted at this station - // small airport --> no helicopters (AIRCRAFT_ONLY) - // all other airports --> all types of flying devices (ALL) - // heliport/oilrig, etc --> no airplanes (HELICOPTERS_ONLY) // runway busy or not allowed to use this airstation, circle - if (v->subtype != apc->acc_planes && + if (apc->flags & (v->subtype == AIR_HELICOPTER ? AirportFTAClass::HELICOPTERS : AirportFTAClass::PLANES) && st->airport_tile != 0 && (st->owner == OWNER_NONE || st->owner == v->owner)) { // {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41}, -- cgit v1.2.3-54-g00ecf