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
commitf5b564bc44a449b839669d63dda59e3941383fbe (patch)
tree5c52e064b06b38d8991161e44f238635f6204f69 /train_cmd.c
parent784801f930cb83f5829209bf8651645ed7c1d814 (diff)
downloadopenttd-f5b564bc44a449b839669d63dda59e3941383fbe.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?