summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-01-06 22:24:02 +0000
committerfrosch <frosch@openttd.org>2011-01-06 22:24:02 +0000
commit29a0dd65a944c1b5af6adbeedfcf5eca84d1a3f0 (patch)
tree7c80c7efa8f3fffd1250cd22ab3dfb3dc591f9c9
parent4863d934af783f8b4295e9817777ede097d0dc4b (diff)
downloadopenttd-29a0dd65a944c1b5af6adbeedfcf5eca84d1a3f0.tar.xz
(svn r21737) -Fix (r1)[FS#4384-ish]: A loading order was also marked as 'not part of orders' when the order before the current order was deleted.
-rw-r--r--src/order_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 6b9a69dbe..096b10e52 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -796,8 +796,6 @@ void DeleteOrder(Vehicle *v, VehicleOrderID sel_ord)
Vehicle *u = v->FirstShared();
DeleteOrderWarnings(u);
for (; u != NULL; u = u->NextShared()) {
- if (sel_ord < u->cur_order_index) u->cur_order_index--;
-
assert(v->orders.list == u->orders.list);
/* NON-stop flag is misused to see if a train is in a station that is
@@ -809,6 +807,8 @@ void DeleteOrder(Vehicle *v, VehicleOrderID sel_ord)
if (u->current_order.GetLoadType() & OLFB_FULL_LOAD) u->current_order.SetLoadType(OLF_LOAD_IF_POSSIBLE);
}
+ if (sel_ord < u->cur_order_index) u->cur_order_index--;
+
/* Update any possible open window of the vehicle */
InvalidateVehicleOrder(u, sel_ord | (INVALID_VEH_ORDER_ID << 8));
}