summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/order_cmd.cpp')
-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);