mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-19 15:25:39 +00:00
(svn r4227) - Fix: Wagon replace nows checks if the cargo types are the same before seeing if it can refit.
This commit is contained in:
parent
9b44cd5dad
commit
98c77c363f
10
vehicle.c
10
vehicle.c
@ -1760,9 +1760,13 @@ 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);
|
||||||
continue;
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now replace the vehicle */
|
/* Now replace the vehicle */
|
||||||
|
Loading…
Reference in New Issue
Block a user