summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-14 16:49:21 +0000
committerrubidium <rubidium@openttd.org>2008-09-14 16:49:21 +0000
commit31494d756a8b8c895f823293ddc514f0e305d3f0 (patch)
tree6599ac9d18b051b738f2d51222213f17d5bf3bfc /src/vehicle.cpp
parent50b955542d712f75e851420f833e96874f2f6e07 (diff)
downloadopenttd-31494d756a8b8c895f823293ddc514f0e305d3f0.tar.xz
(svn r14324) -Fix [FS#2241]: free any blocks that a helicopter may have on an oilrig when the helicopter gets forcefully removed (bankruptcy). For other airports this isn't needed as they can't be used by multiple companies.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index ce757c470..943fc7076 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -651,6 +651,11 @@ void Vehicle::PreDestructor()
}
if (this->type == VEH_ROAD) ClearSlot(this);
+ if (this->type == VEH_AIRCRAFT && this->IsPrimaryVehicle()) {
+ Station *st = GetStation(this->u.air.targetairport);
+ const AirportFTA *layout = st->Airport()->layout;
+ CLRBITS(st->airport_flags, layout[this->u.air.previous_pos].block | layout[this->u.air.pos].block);
+ }
if (this->type != VEH_TRAIN || (this->type == VEH_TRAIN && (IsFrontEngine(this) || IsFreeWagon(this)))) {
InvalidateWindowData(WC_VEHICLE_DEPOT, this->tile);