Codechange: Store the rail type of rail engines as a RailTypes bitmask.
This commit is contained in:
12
src/rail.cpp
12
src/rail.cpp
@@ -132,11 +132,11 @@ RailTypes GetCompanyRailTypes(CompanyID company, bool introduces)
|
||||
const RailVehicleInfo *rvi = &e->u.rail;
|
||||
|
||||
if (rvi->railveh_type != RAILVEH_WAGON) {
|
||||
assert(rvi->railtype < RAILTYPE_END);
|
||||
assert(rvi->railtypes.Any());
|
||||
if (introduces) {
|
||||
rts.Set(GetRailTypeInfo(rvi->railtype)->introduces_railtypes);
|
||||
rts.Set(GetAllIntroducesRailTypes(rvi->railtypes));
|
||||
} else {
|
||||
rts.Set(rvi->railtype);
|
||||
rts.Set(rvi->railtypes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,11 +161,11 @@ RailTypes GetRailTypes(bool introduces)
|
||||
|
||||
const RailVehicleInfo *rvi = &e->u.rail;
|
||||
if (rvi->railveh_type != RAILVEH_WAGON) {
|
||||
assert(rvi->railtype < RAILTYPE_END);
|
||||
assert(rvi->railtypes.Any());
|
||||
if (introduces) {
|
||||
rts.Set(GetRailTypeInfo(rvi->railtype)->introduces_railtypes);
|
||||
rts.Set(GetAllIntroducesRailTypes(rvi->railtypes));
|
||||
} else {
|
||||
rts.Set(rvi->railtype);
|
||||
rts.Set(rvi->railtypes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user