(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.
authorrubidium
Sun, 14 Sep 2008 16:49:21 +0000
changeset 10138 fca05009f8ce
parent 10137 189e1e91fe82
child 10139 fb3c1057d71b
(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
--- a/src/vehicle.cpp	Sun Sep 14 16:01:46 2008 +0000
+++ b/src/vehicle.cpp	Sun Sep 14 16:49:21 2008 +0000
@@ -651,6 +651,11 @@
 	}
 
 	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);