(svn r22330) -Change: When a conditional order triggers and causes skipping to a particular order, disable modifications to automatic orders. till reaching the next real order, as we do not know whether to change the targets of conditional orders when inserting automatic orders. (So, when the vehicle skips to an order and later inserts an automatic order, the conditional order will still point to the same order, so the automatic order will be inserted again the next time.)

pull/155/head
frosch 13 years ago
parent 1ef4e543e7
commit aee1e06273

@ -1865,6 +1865,13 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth)
v->cur_auto_order_index = v->cur_real_order_index = next_order;
v->UpdateRealOrderIndex();
v->current_order_time += v->GetOrder(v->cur_real_order_index)->travel_time;
/* Disable creation of automatic orders.
* When inserting them we do not know that we would have to make the conditional orders point to them. */
if (v->IsGroundVehicle()) {
uint16 &gv_flags = v->GetGroundVehicleFlags();
SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
}
} else {
UpdateVehicleTimetable(v, true);
v->IncrementRealOrderIndex();

Loading…
Cancel
Save