Mercurial > hg > openttd
changeset 17446:7018bffbfa1b draft
(svn r22200) -Fix (r21642): removing a station order could stop when removing first automatic order
author | smatz <smatz@openttd.org> |
---|---|
date | Sat, 05 Mar 2011 13:59:23 +0000 |
parents | f4b87d29bafd |
children | 1b0b1b2d7b18 |
files | src/order_cmd.cpp |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1638,6 +1638,7 @@ int id = -1; FOR_VEHICLE_ORDERS(v, order) { id++; +restart: OrderType ot = order->GetType(); if (ot == OT_GOTO_DEPOT && (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) continue; @@ -1647,9 +1648,10 @@ * dummy orders. They should just vanish. Also check the actual order * type as ot is currently OT_GOTO_STATION. */ if (order->IsType(OT_AUTOMATIC)) { + order = order->next; // DeleteOrder() invalidates current order DeleteOrder(v, id); - id--; - continue; + if (order != NULL) goto restart; + break; } order->MakeDummy();