mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r22250) -Cleanup (r16378): Engines poolitems do not need a flag for validness anymore. The pool knows that on its own.
This commit is contained in:
parent
8c8349d5da
commit
e1b7474b99
@ -85,8 +85,6 @@ Engine::Engine(VehicleType type, EngineID base)
|
||||
|
||||
/* Check if this base engine is within the original engine data range */
|
||||
if (base >= _engine_counts[type]) {
|
||||
/* Mark engine as valid anyway */
|
||||
this->info.climates = 0x80;
|
||||
/* Set model life to maximum to make wagons available */
|
||||
this->info.base_life = 0xFF;
|
||||
/* Set road vehicle tractive effort to the default value */
|
||||
|
@ -511,9 +511,6 @@ static ChangeInfoResult CommonVehicleChangeInfo(EngineInfo *ei, int prop, ByteRe
|
||||
|
||||
case 0x06: // Climates available
|
||||
ei->climates = buf->ReadByte();
|
||||
/* Sometimes a GRF wants hidden vehicles. Setting climates to
|
||||
* zero may cause the ID to be reallocated. */
|
||||
if (ei->climates == 0) ei->climates = 0x80;
|
||||
break;
|
||||
|
||||
case 0x07: // Loading speed
|
||||
@ -7479,7 +7476,7 @@ static void CalculateRefitMasks()
|
||||
/* 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. */
|
||||
if (ei->cargo_type == CT_INVALID && ei->refit_mask != 0) ei->cargo_type = (CargoID)FindFirstBit(ei->refit_mask);
|
||||
if (ei->cargo_type == CT_INVALID) ei->climates = 0x80;
|
||||
if (ei->cargo_type == CT_INVALID) ei->climates = 0;
|
||||
|
||||
/* Clear refit_mask for not refittable ships */
|
||||
if (e->type == VEH_SHIP && !e->u.ship.old_refittable) ei->refit_mask = 0;
|
||||
@ -8195,7 +8192,7 @@ static void AfterLoadGRFs()
|
||||
RailType railtype = GetRailTypeByLabel(_gted[e->index].railtypelabel);
|
||||
if (railtype == INVALID_RAILTYPE) {
|
||||
/* Rail type is not available, so disable this engine */
|
||||
e->info.climates = 0x80;
|
||||
e->info.climates = 0;
|
||||
} else {
|
||||
e->u.rail.railtype = railtype;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user