From 7c8a50d7d899c6e5694825ecc8dad950adbc4079 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 14 Sep 2008 16:49:21 +0000 Subject: [PATCH] (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. --- src/vehicle.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index ce757c470c..943fc7076a 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);