mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r23836) -Fix (r23145): If a vehicle is not refittable to any cargo in the CTT, then pick the first refittable cargoslot.
This commit is contained in:
parent
5bf1710a28
commit
3c85689b72
@ -8185,10 +8185,7 @@ static void CalculateRefitMasks()
|
|||||||
/* Check if this engine's cargo type is valid. If not, set to the first refittable
|
/* Check if this engine's cargo type is valid. If not, set to the first refittable
|
||||||
* cargo type. Finally disable the vehicle, if there is still no cargo. */
|
* cargo type. Finally disable the vehicle, if there is still no cargo. */
|
||||||
if (ei->cargo_type == CT_INVALID && ei->refit_mask != 0) {
|
if (ei->cargo_type == CT_INVALID && ei->refit_mask != 0) {
|
||||||
if (cargo_map_for_first_refittable == NULL) {
|
if (cargo_map_for_first_refittable != NULL) {
|
||||||
/* Use first refittable cargo slot */
|
|
||||||
ei->cargo_type = (CargoID)FindFirstBit(ei->refit_mask);
|
|
||||||
} else {
|
|
||||||
/* Use first refittable cargo from cargo translation table */
|
/* Use first refittable cargo from cargo translation table */
|
||||||
byte best_local_slot = 0xFF;
|
byte best_local_slot = 0xFF;
|
||||||
CargoID cargo_type;
|
CargoID cargo_type;
|
||||||
@ -8200,6 +8197,11 @@ static void CalculateRefitMasks()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ei->cargo_type == CT_INVALID) {
|
||||||
|
/* Use first refittable cargo slot */
|
||||||
|
ei->cargo_type = (CargoID)FindFirstBit(ei->refit_mask);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ei->cargo_type == CT_INVALID) ei->climates = 0;
|
if (ei->cargo_type == CT_INVALID) ei->climates = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user