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 | 50fd9c8f73d68766a2a84d26c48a6787008a1f85 (patch) | |
tree | 5c52e064b06b38d8991161e44f238635f6204f69 /ship_cmd.c | |
parent | c60b3216ae4d9c427f626a21fdb19ddc1bd36361 (diff) | |
download | openttd-50fd9c8f73d68766a2a84d26c48a6787008a1f85.tar.xz |
(svn r3585) Similar changes to the order handlers of the other vehicle types like r3584
Diffstat (limited to 'ship_cmd.c')
-rw-r--r-- | ship_cmd.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/ship_cmd.c b/ship_cmd.c index 3a80aca09..651239286 100644 --- a/ship_cmd.c +++ b/ship_cmd.c @@ -203,22 +203,21 @@ static void ProcessShipOrder(Vehicle *v) { const Order *order; - if (v->current_order.type >= OT_GOTO_DEPOT && - v->current_order.type <= OT_LEAVESTATION) { - 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: + case OT_LEAVESTATION: + return; } - - if (v->cur_order_index >= v->num_orders) - v->cur_order_index = 0; + if (v->cur_order_index >= v->num_orders) v->cur_order_index = 0; order = GetVehicleOrder(v, v->cur_order_index); |