diff options
author | tron <tron@openttd.org> | 2006-02-10 06:33:56 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-10 06:33:56 +0000 |
commit | f5b564bc44a449b839669d63dda59e3941383fbe (patch) | |
tree | 5c52e064b06b38d8991161e44f238635f6204f69 /aircraft_cmd.c | |
parent | 784801f930cb83f5829209bf8651645ed7c1d814 (diff) | |
download | openttd-f5b564bc44a449b839669d63dda59e3941383fbe.tar.xz |
(svn r3585) Similar changes to the order handlers of the other vehicle types like r3584
Diffstat (limited to 'aircraft_cmd.c')
-rw-r--r-- | aircraft_cmd.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c index d1cc12a46..75aacb6a9 100644 --- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -1043,19 +1043,17 @@ static void ProcessAircraftOrder(Vehicle *v) { const Order *order; - // OT_GOTO_DEPOT, OT_LOADING - if (v->current_order.type == OT_GOTO_DEPOT || - v->current_order.type == OT_LOADING) { - if (v->current_order.type != OT_GOTO_DEPOT || - !(v->current_order.flags & OF_UNLOAD)) - return; - } + switch (v->current_order.type) { + case OT_GOTO_DEPOT: + if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return; + if (v->current_order.flags & OF_SERVICE_IF_NEEDED && + !VehicleNeedsService(v)) { + v->cur_order_index++; + } + break; - if (v->current_order.type == OT_GOTO_DEPOT && - (v->current_order.flags & (OF_PART_OF_ORDERS | OF_SERVICE_IF_NEEDED)) == (OF_PART_OF_ORDERS | OF_SERVICE_IF_NEEDED) && - !VehicleNeedsService(v)) { - v->cur_order_index++; - } + case OT_LOADING: return; + } if (v->cur_order_index >= v->num_orders) v->cur_order_index = 0; @@ -1067,8 +1065,7 @@ static void ProcessAircraftOrder(Vehicle *v) return; } - if (order->type == OT_DUMMY && !CheckForValidOrders(v)) - CrashAirplane(v); + if (order->type == OT_DUMMY && !CheckForValidOrders(v)) CrashAirplane(v); if (order->type == v->current_order.type && order->flags == v->current_order.flags && |