mirror of https://github.com/OpenTTD/OpenTTD
(svn r14492) -Fix [FS#2366] (r14482): Conditional orders could lead to an infinite loop on path look-ahead.
Don't refactor things that don't want to be refactored, folks. And some comments can't hurt either.release/0.7
parent
d832626bb9
commit
6815cc52fe
|
@ -2857,6 +2857,7 @@ public:
|
||||||
VehicleOrderID next = ProcessConditionalOrder(order, this->v);
|
VehicleOrderID next = ProcessConditionalOrder(order, this->v);
|
||||||
if (next != INVALID_VEH_ORDER_ID) {
|
if (next != INVALID_VEH_ORDER_ID) {
|
||||||
this->index = next;
|
this->index = next;
|
||||||
|
/* Don't increment next, so no break here. */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2864,7 +2865,10 @@ public:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (++this->index != this->v->cur_order_index);
|
/* Don't increment inside the while because otherwise conditional
|
||||||
|
* orders can lead to an infinite loop. */
|
||||||
|
++this->index;
|
||||||
|
} while (this->index != this->v->cur_order_index);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue