(svn r14826) -Fix [FS#2494]: infinite loop in order lookahead when reserving a path (Swallow)

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 16 years ago
parent 2283b8038f
commit ce5304f9a2

@ -2849,6 +2849,8 @@ public:
{
++this->index;
int conditional_depth = 0;
do {
/* Wrap around. */
if (this->index >= this->v->GetNumOrders()) this->index = 0;
@ -2866,8 +2868,10 @@ public:
UpdateOrderDest(this->v, order);
return true;
case OT_CONDITIONAL: {
if (conditional_depth > this->v->GetNumOrders()) return false;
VehicleOrderID next = ProcessConditionalOrder(order, this->v);
if (next != INVALID_VEH_ORDER_ID) {
conditional_depth++;
this->index = next;
/* Don't increment next, so no break here. */
continue;

Loading…
Cancel
Save