(svn r22520) [1.1] -Backport from trunk:

- Fix: Only try to insert implicit orders for ground vehicles. Aircraft may reach unscheduled terminals when skipping orders etc [FS#4624] (r22492)
- Change: Automatic orders are better called implicit orders as no real order influencing path finding is added (r22474, r22473)
This commit is contained in:
rubidium
2011-05-29 17:55:15 +00:00
parent 7fcdcbc8dd
commit c224791f7f
62 changed files with 208 additions and 208 deletions
+5 -5
View File
@@ -66,11 +66,11 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
if (order_position == AIOrder::ORDER_INVALID) return NULL;
}
const Order *order = v->orders.list->GetFirstOrder();
while (order->GetType() == OT_AUTOMATIC) order = order->next;
while (order->GetType() == OT_IMPLICIT) order = order->next;
while (order_position > 0) {
order_position = (AIOrder::OrderPosition)(order_position - 1);
order = order->next;
while (order->GetType() == OT_AUTOMATIC) order = order->next;
while (order->GetType() == OT_IMPLICIT) order = order->next;
}
return order;
}
@@ -135,12 +135,12 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
int cur_order_pos = ::Vehicle::Get(vehicle_id)->cur_real_order_index;
const Order *order = ::Vehicle::Get(vehicle_id)->GetOrder(0);
if (order == NULL) return ORDER_INVALID;
int num_automatic_orders = 0;
int num_implicit_orders = 0;
for (int i = 0; i < cur_order_pos; i++) {
if (order->GetType() == OT_AUTOMATIC) num_automatic_orders++;
if (order->GetType() == OT_IMPLICIT) num_implicit_orders++;
order = order->next;
}
return (AIOrder::OrderPosition)(cur_order_pos - num_automatic_orders);
return (AIOrder::OrderPosition)(cur_order_pos - num_implicit_orders);
}
return (order_position >= 0 && order_position < ::Vehicle::Get(vehicle_id)->GetNumManualOrders()) ? order_position : ORDER_INVALID;
}