@@ -1841,27 +1841,27 @@ void Vehicle::DeleteUnreachedImplicitOrd
ClrBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
this->cur_implicit_order_index = this->cur_real_order_index;
InvalidateVehicleOrder(this, 0);
return;
}
const Order *order = this->GetOrder(this->cur_implicit_order_index);
while (order != NULL) {
if (this->cur_implicit_order_index == this->cur_real_order_index) break;
if (order->IsType(OT_IMPLICIT)) {
/* Delete order effectively deletes order, so get the next before deleting it. */
order = order->next;
DeleteOrder(this, this->cur_implicit_order_index);
/* DeleteOrder does various magic with order_indices, so resync 'order' with 'cur_implicit_order_index' */
order = this->GetOrder(this->cur_implicit_order_index);
} else {
/* Skip non-implicit orders, e.g. service-orders */
this->cur_implicit_order_index++;
/* Wrap around */
if (order == NULL) {
order = this->GetOrder(0);
this->cur_implicit_order_index = 0;
@@ -1923,27 +1923,27 @@ void Vehicle::BeginLoading()
if (found) {
if (suppress_implicit_orders) {
/* Skip to the found order */
this->cur_implicit_order_index = target_index;
/* Delete all implicit orders up to the station we just reached */
while (!order->IsType(OT_IMPLICIT) || order->GetDestination() != this->last_station_visited) {
assert(order != NULL);
Status change: