--- a/src/aircraft_cmd.cpp Tue Aug 14 19:25:47 2007 +0000
+++ b/src/aircraft_cmd.cpp Tue Aug 14 21:25:25 2007 +0000
@@ -1633,8 +1633,10 @@
/* airplane goto state takeoff, helicopter to helitakeoff */
v->u.air.state = (v->subtype == AIR_HELICOPTER) ? HELITAKEOFF : TAKEOFF;
}
- AircraftLeaveHangar(v);
+
+ 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
}
/** At one of the Airport's Terminals */