(svn r10901) [NewGRF_ports] -Fix: Aircraft that failed to exit the hangar should unreserve any terminal reservations they made. NewGRF_ports
authorrichk
Tue, 14 Aug 2007 23:41:36 +0000
branchNewGRF_ports
changeset 6821 1e2dd2497cb2
parent 6820 c3326ce38a0c
child 6822 5ac6f657d6fc
(svn r10901) [NewGRF_ports] -Fix: Aircraft that failed to exit the hangar should unreserve any terminal reservations they made.
src/aircraft_cmd.cpp
--- a/src/aircraft_cmd.cpp	Tue Aug 14 22:57:52 2007 +0000
+++ b/src/aircraft_cmd.cpp	Tue Aug 14 23:41:36 2007 +0000
@@ -1636,7 +1636,14 @@
 
 	byte prev_pos = v->u.air.pos; // location could be changed in state, so save it before-hand
 	AirportMove(v, apc);
-	if (v->u.air.pos != prev_pos) AircraftLeaveHangar(v);  //only leave the hangar if we have succeeded in finding another position to move to
+	if (v->u.air.pos != prev_pos) {
+		AircraftLeaveHangar(v);  //only leave the hangar if we have succeeded in finding another position to move to
+	} else {
+		/* release any reserved terminals */
+		Station *st = GetStation(v->u.air.targetairport);
+		st->airport_flags.ReleaseLowerBlocks(&v->u.air.owned_blocks);
+		v->u.air.owned_blocks.ReleaseLowerBlocks(&v->u.air.owned_blocks);
+	}
 }
 
 /** At one of the Airport's Terminals */