summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2012-04-17 19:43:18 +0000
committermichi_cc <michi_cc@openttd.org>2012-04-17 19:43:18 +0000
commitaa47d6c7f2b18d5277ed8d1e47f078e6d73bc6b9 (patch)
treec9dfb4e1826ddbef58cc31872029e49d18c9d9bd /src/aircraft_cmd.cpp
parentaf6a33bd1c191f1fcb60f85d8c2c38eca6db4cc5 (diff)
downloadopenttd-aa47d6c7f2b18d5277ed8d1e47f078e6d73bc6b9.tar.xz
(svn r24127) -Feature [FS#1497]: Allow closing airports for incoming aircraft. (Based on patch by cirdan)
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 7bdba7dea..bff07382c 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -1461,8 +1461,8 @@ 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 (CanVehicleUseStation(v, st) && (st->owner == OWNER_NONE || st->owner == v->owner)) {
+ /* Runway busy, not allowed to use this airstation or closed, circle. */
+ if (CanVehicleUseStation(v, st) && (st->owner == OWNER_NONE || st->owner == v->owner) && !(st->airport.flags & AIRPORT_CLOSED_block)) {
/* {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 */