mirror of https://github.com/OpenTTD/OpenTTD
(svn r20476) -Codechange: simplify a check in aircraft_cmd.cpp by using the existing CanVehicleUseStation
parent
53811d79c5
commit
6babc60254
|
@ -1529,9 +1529,7 @@ static void AircraftEventHandler_Flying(Aircraft *v, const AirportFTAClass *apc)
|
||||||
Station *st = Station::Get(v->targetairport);
|
Station *st = Station::Get(v->targetairport);
|
||||||
|
|
||||||
/* runway busy or not allowed to use this airstation, circle */
|
/* runway busy or not allowed to use this airstation, circle */
|
||||||
if ((apc->flags & (v->subtype == AIR_HELICOPTER ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES)) &&
|
if (CanVehicleUseStation(v, st) && (st->owner == OWNER_NONE || st->owner == v->owner)) {
|
||||||
st->airport.tile != INVALID_TILE &&
|
|
||||||
(st->owner == OWNER_NONE || st->owner == v->owner)) {
|
|
||||||
/* {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41},
|
/* {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41},
|
||||||
* if it is an airplane, look for LANDING, for helicopter HELILANDING
|
* 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 */
|
* it is possible to choose from multiple landing runways, so loop until a free one is found */
|
||||||
|
|
Loading…
Reference in New Issue