summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-10 06:33:56 +0000
committertron <tron@openttd.org>2006-02-10 06:33:56 +0000
commit50fd9c8f73d68766a2a84d26c48a6787008a1f85 (patch)
tree5c52e064b06b38d8991161e44f238635f6204f69 /train_cmd.c
parentc60b3216ae4d9c427f626a21fdb19ddc1bd36361 (diff)
downloadopenttd-50fd9c8f73d68766a2a84d26c48a6787008a1f85.tar.xz
(svn r3585) Similar changes to the order handlers of the other vehicle types like r3584
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 21839c44b..403093b06 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2274,19 +2274,18 @@ static bool ProcessTrainOrder(Vehicle *v)
const Order *order;
bool result;
- // These are un-interruptible
- if (v->current_order.type >= OT_GOTO_DEPOT &&
- v->current_order.type <= OT_LEAVESTATION) {
- // Let a depot order in the orderlist interrupt.
- if (v->current_order.type != OT_GOTO_DEPOT ||
- !(v->current_order.flags & OF_UNLOAD))
- return false;
- }
+ switch (v->current_order.type) {
+ case OT_GOTO_DEPOT:
+ if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return false;
+ 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 false;
}
// check if we've reached the waypoint?