|
|
@ -1760,10 +1760,14 @@ static void MaybeReplaceVehicle(Vehicle *v)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (w->type == VEH_Train && IsTrainWagon(w) && !CanRefitTo(EngineReplacementForPlayer(p, w->engine_type), w->cargo_type)) {
|
|
|
|
if (w->type == VEH_Train && IsTrainWagon(w)) {
|
|
|
|
// we can't replace this wagon since we can't refit the new one to the right cargo type
|
|
|
|
EngineID e = EngineReplacementForPlayer(p, w->engine_type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (w->cargo_type != RailVehInfo(e)->cargo_type && !CanRefitTo(e, w->cargo_type)) {
|
|
|
|
|
|
|
|
// we can't replace this wagon since the cargo type is incorrent, and we can't refit it
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Now replace the vehicle */
|
|
|
|
/* Now replace the vehicle */
|
|
|
|
temp_cost = ReplaceVehicle(&w, flags);
|
|
|
|
temp_cost = ReplaceVehicle(&w, flags);
|
|
|
|