summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-22 20:07:26 +0000
committerrubidium <rubidium@openttd.org>2009-05-22 20:07:26 +0000
commitc882248348510265e1926b0abc031b4c6fb0f97f (patch)
treee2e97af6a402e4babea7d19de728a50ead416f51 /src/order_cmd.cpp
parentada30679605644a228be26850a76370fea723799 (diff)
downloadopenttd-c882248348510265e1926b0abc031b4c6fb0f97f.tar.xz
(svn r16388) -Codechange: move u.air to Aircraft
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp11
1 files changed, 7 insertions, 4 deletions
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);