summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2013-08-11 11:00:09 +0000
committerfonsinchen <fonsinchen@openttd.org>2013-08-11 11:00:09 +0000
commitb98de55d22ba5b9d7af45f8136aaa2432bcef582 (patch)
tree612c376d5612b309eb3c7e9932cb78ebff712ba8 /src
parent1137e250a075aa88a899d023ff031b149e3c9061 (diff)
downloadopenttd-b98de55d22ba5b9d7af45f8136aaa2432bcef582.tar.xz
(svn r25718) -Fix: return INVALID from GetNextStoppingStation if vehicle would have to unload everything at this same station at the next stop
Diffstat (limited to 'src')
-rw-r--r--src/order_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 419d09691..a9882dd29 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);