mirror of https://github.com/OpenTTD/OpenTTD
(svn r25718) -Fix: return INVALID from GetNextStoppingStation if vehicle would have to unload everything at this same station at the next stop
parent
1137e250a0
commit
b98de55d22
|
@ -466,8 +466,9 @@ StationID OrderList::GetNextStoppingStation(const Vehicle *v) const
|
||||||
do {
|
do {
|
||||||
next = this->GetNextStoppingOrder(v, next, ++hops, true);
|
next = this->GetNextStoppingOrder(v, next, ++hops, true);
|
||||||
/* Don't return a next stop if the vehicle has to unload everything. */
|
/* Don't return a next stop if the vehicle has to unload everything. */
|
||||||
if (next == NULL || (next->GetDestination() == v->last_station_visited &&
|
if (next == NULL || ((next->IsType(OT_GOTO_STATION) || next->IsType(OT_IMPLICIT)) &&
|
||||||
(next->GetUnloadType() & (OUFB_TRANSFER | OUFB_UNLOAD)) == 0)) {
|
next->GetDestination() == v->last_station_visited &&
|
||||||
|
(next->GetUnloadType() & (OUFB_TRANSFER | OUFB_UNLOAD)) != 0)) {
|
||||||
return INVALID_STATION;
|
return INVALID_STATION;
|
||||||
}
|
}
|
||||||
} while (next->IsType(OT_GOTO_DEPOT) || next->GetDestination() == v->last_station_visited);
|
} while (next->IsType(OT_GOTO_DEPOT) || next->GetDestination() == v->last_station_visited);
|
||||||
|
|
Loading…
Reference in New Issue