mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-30 18:09:09 +00:00
(svn r25718) -Fix: return INVALID from GetNextStoppingStation if vehicle would have to unload everything at this same station at the next stop
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user