summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-07-05 19:09:18 +0000
committerfrosch <frosch@openttd.org>2013-07-05 19:09:18 +0000
commit840f836704aceaae8e1bd2d3b671baf92887f84c (patch)
tree306bdf26cc0d56c4cf45f484bce3f7a01ec76da6 /src
parentc6aad246c9fa4288ac8c423dea4561448a74eef0 (diff)
downloadopenttd-840f836704aceaae8e1bd2d3b671baf92887f84c.tar.xz
(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.
Diffstat (limited to 'src')
-rw-r--r--src/order_cmd.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 71edbb406..419d09691 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -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)
{
- 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()) {
case OT_GOTO_STATION: