From c882248348510265e1926b0abc031b4c6fb0f97f Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 22 May 2009 20:07:26 +0000 Subject: (svn r16388) -Codechange: move u.air to Aircraft --- src/order_cmd.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/order_cmd.cpp') diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index cf527e39a..3dfe2a1eb 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1620,10 +1620,13 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth) /* If there is no depot in front, reverse automatically (trains only) */ if (v->type == VEH_TRAIN && reverse) DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION); - if (v->type == VEH_AIRCRAFT && v->u.air.state == FLYING && v->u.air.targetairport != destination) { - /* The aircraft is now heading for a different hangar than the next in the orders */ - extern void AircraftNextAirportPos_and_Order(Aircraft *a); - AircraftNextAirportPos_and_Order((Aircraft *)v); + if (v->type == VEH_AIRCRAFT) { + Aircraft *a = (Aircraft *)v; + if (a->state == FLYING && a->targetairport != destination) { + /* The aircraft is now heading for a different hangar than the next in the orders */ + extern void AircraftNextAirportPos_and_Order(Aircraft *a); + AircraftNextAirportPos_and_Order(a); + } } } else { UpdateVehicleTimetable(v, true); -- cgit v1.2.3-54-g00ecf