Codechange: Use EnumBitSet for CargoClasses. (#13491)
This commit is contained in:
@@ -446,7 +446,7 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec
|
||||
/* Skip empty engines */
|
||||
if (!u->GetEngine()->CanCarryCargo()) continue;
|
||||
|
||||
cargo_classes |= CargoSpec::Get(u->cargo_type)->classes;
|
||||
cargo_classes |= CargoSpec::Get(u->cargo_type)->classes.base();
|
||||
common_cargoes[u->cargo_type]++;
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec
|
||||
* is object->ro.grffile.
|
||||
* In case of CBID_TRAIN_ALLOW_WAGON_ATTACH this is not the same as v->GetGRF().
|
||||
*/
|
||||
return (cs->classes << 16) | (cs->weight << 8) | object->ro.grffile->cargo_map[v->cargo_type];
|
||||
return (cs->classes.base() << 16) | (cs->weight << 8) | object->ro.grffile->cargo_map[v->cargo_type];
|
||||
}
|
||||
|
||||
case 0x48: return v->GetEngine()->flags.base(); // Vehicle Type Info
|
||||
@@ -952,7 +952,7 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec
|
||||
CargoType cargo_type = e->GetDefaultCargoType();
|
||||
if (IsValidCargoType(cargo_type)) {
|
||||
const CargoSpec *cs = CargoSpec::Get(cargo_type);
|
||||
return (cs->classes << 16) | (cs->weight << 8) | this->ro.grffile->cargo_map[cargo_type];
|
||||
return (cs->classes.base() << 16) | (cs->weight << 8) | this->ro.grffile->cargo_map[cargo_type];
|
||||
} else {
|
||||
return 0x000000FF;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user