Check that order is station type when comparing with last_station_visited

This commit is contained in:
Jonathan G Rennison
2023-04-03 21:27:20 +01:00
parent da97e0d170
commit 0370f2e3f1
2 changed files with 3 additions and 2 deletions

View File

@@ -677,7 +677,8 @@ CargoMaskedStationIDStack OrderList::GetNextStoppingStation(const Vehicle *v, Ca
});
if (invalid) return CargoMaskedStationIDStack(cargo_mask, INVALID_STATION);
}
} while (next->IsType(OT_GOTO_DEPOT) || next->IsType(OT_RELEASE_SLOT) || next->IsType(OT_COUNTER) || next->IsType(OT_DUMMY) || next->GetDestination() == v->last_station_visited);
} while (next->IsType(OT_GOTO_DEPOT) || next->IsType(OT_RELEASE_SLOT) || next->IsType(OT_COUNTER) || next->IsType(OT_DUMMY)
|| (next->IsBaseStationOrder() && next->GetDestination() == v->last_station_visited));
return CargoMaskedStationIDStack(cargo_mask, next->GetDestination());
}