summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 14718a45d..8076b95a2 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1968,7 +1968,8 @@ static CommandCost RemoveAirport(Station *st, DoCommandFlag flags)
FOR_ALL_VEHICLES(v) {
if (!(v->type == VEH_AIRCRAFT && IsNormalAircraft(v))) continue;
- if (v->u.air.targetairport == st->index && v->u.air.state != FLYING) return CMD_ERROR;
+ Aircraft *a = (Aircraft *)v;
+ if (a->targetairport == st->index && a->state != FLYING) return CMD_ERROR;
}
BEGIN_TILE_LOOP(tile_cur, w, h, tile) {