Codechange: Use EnumBitSet for RailTypes.

This commit is contained in:
Peter Nelson
2025-03-24 20:35:57 +00:00
committed by Peter Nelson
parent 732109e444
commit 47d078c033
14 changed files with 67 additions and 77 deletions
+1 -1
View File
@@ -1276,7 +1276,7 @@ bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
if (type == VEH_TRAIN && company != OWNER_DEITY) {
/* Check if the rail type is available to this company */
const Company *c = Company::Get(company);
if (((GetRailTypeInfo(e->u.rail.railtype))->compatible_railtypes & c->avail_railtypes) == 0) return false;
if (!GetRailTypeInfo(e->u.rail.railtype)->compatible_railtypes.Any(c->avail_railtypes)) return false;
}
if (type == VEH_ROAD && company != OWNER_DEITY) {
/* Check if the road type is available to this company */