Fix refit in station with articulated vehicles with no capacity in leading part

This commit is contained in:
Jonathan G Rennison
2023-06-18 11:08:35 +01:00
parent dadebfa759
commit 846737e56a
3 changed files with 15 additions and 1 deletions

View File

@@ -1762,7 +1762,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station
}
/* Refit if given a valid cargo. */
if (new_cid < NUM_CARGO && new_cid != v_start->cargo_type) {
if (new_cid < NUM_CARGO && new_cid != GetOverallCargoOfArticulatedVehicle(v_start)) {
/* INVALID_STATION because in the DT_MANUAL case that's correct and in the DT_(A)SYMMETRIC
* cases the next hop of the vehicle doesn't really tell us anything if the cargo had been
* "via any station" before reserving. We rather produce some more "any station" cargo than