summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 03d7a9db8..97713dfbf 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -70,9 +70,10 @@ Station::~Station()
Vehicle *v;
FOR_ALL_VEHICLES(v) {
- if (v->type == VEH_AIRCRAFT && IsNormalAircraft(v) && v->u.air.targetairport == this->index) {
- v->u.air.targetairport = INVALID_STATION;
- }
+ if (v->type != VEH_AIRCRAFT || !IsNormalAircraft(v)) continue;
+
+ Aircraft *a = (Aircraft *)v;
+ if (a->targetairport == this->index) a->targetairport = INVALID_STATION;
}
MarkDirty();