diff options
author | yexo <yexo@openttd.org> | 2010-08-12 22:36:42 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-08-12 22:36:42 +0000 |
commit | 6babc602542ebb2b6fb43fd2f2f46cc7ed4c2236 (patch) | |
tree | f917616d102ce6bde65e071bcc26109c60e3cad3 /src/aircraft_cmd.cpp | |
parent | 53811d79c5854becda79a6ceb052031dade8dd99 (diff) | |
download | openttd-6babc602542ebb2b6fb43fd2f2f46cc7ed4c2236.tar.xz |
(svn r20476) -Codechange: simplify a check in aircraft_cmd.cpp by using the existing CanVehicleUseStation
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index b778dc620..6664cef72 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1529,9 +1529,7 @@ static void AircraftEventHandler_Flying(Aircraft *v, const AirportFTAClass *apc) Station *st = Station::Get(v->targetairport); /* runway busy or not allowed to use this airstation, circle */ - if ((apc->flags & (v->subtype == AIR_HELICOPTER ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES)) && - st->airport.tile != INVALID_TILE && - (st->owner == OWNER_NONE || st->owner == v->owner)) { + if (CanVehicleUseStation(v, st) && (st->owner == OWNER_NONE || st->owner == v->owner)) { /* {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41}, * if it is an airplane, look for LANDING, for helicopter HELILANDING * it is possible to choose from multiple landing runways, so loop until a free one is found */ |