(svn r25562) -Fix [FS#5633]: If the next order cannot be resolved, reset the current order property instead of leaving it in an intermediate state.

This commit is contained in:
frosch 2013-07-05 19:09:18 +00:00
parent c6aad246c9
commit 840f836704

View File

@ -2025,7 +2025,11 @@ VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v)
*/ */
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool pbs_look_ahead) bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool pbs_look_ahead)
{ {
if (conditional_depth > v->GetNumOrders()) return false; if (conditional_depth > v->GetNumOrders()) {
v->current_order.Free();
v->dest_tile = 0;
return false;
}
switch (order->GetType()) { switch (order->GetType()) {
case OT_GOTO_STATION: case OT_GOTO_STATION: