Codechange: use EnumBitSet for CargoTypes

This commit is contained in:
Peter Nelson
2026-04-21 17:13:31 +01:00
committed by Peter Nelson
parent 962a550d1b
commit c45aa3c9b6
55 changed files with 278 additions and 265 deletions
+1 -1
View File
@@ -479,7 +479,7 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec
}
/* The cargo translation is specific to the accessing GRF, and thus cannot be cached. */
CargoType common_cargo_type = (v->grf_cache.consist_cargo_information >> 8) & 0xFF;
CargoType common_cargo_type = static_cast<CargoType>(GB(v->grf_cache.consist_cargo_information, 8, 8));
/* Note:
* - Unlike everywhere else the cargo translation table is only used since grf version 8, not 7.