(svn r3585) Similar changes to the order handlers of the other vehicle types like r3584

This commit is contained in:
tron
2006-02-10 06:33:56 +00:00
parent 784801f930
commit f5b564bc44
3 changed files with 34 additions and 39 deletions

View File

@@ -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?