From b98de55d22ba5b9d7af45f8136aaa2432bcef582 Mon Sep 17 00:00:00 2001 From: fonsinchen Date: Sun, 11 Aug 2013 11:00:09 +0000 Subject: [PATCH] (svn r25718) -Fix: return INVALID from GetNextStoppingStation if vehicle would have to unload everything at this same station at the next stop --- src/order_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 419d096918..a9882dd29e 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -466,8 +466,9 @@ StationID OrderList::GetNextStoppingStation(const Vehicle *v) const do { next = this->GetNextStoppingOrder(v, next, ++hops, true); /* Don't return a next stop if the vehicle has to unload everything. */ - if (next == NULL || (next->GetDestination() == v->last_station_visited && - (next->GetUnloadType() & (OUFB_TRANSFER | OUFB_UNLOAD)) == 0)) { + if (next == NULL || ((next->IsType(OT_GOTO_STATION) || next->IsType(OT_IMPLICIT)) && + next->GetDestination() == v->last_station_visited && + (next->GetUnloadType() & (OUFB_TRANSFER | OUFB_UNLOAD)) != 0)) { return INVALID_STATION; } } while (next->IsType(OT_GOTO_DEPOT) || next->GetDestination() == v->last_station_visited);