(svn r21841) -Feature: [NewGRF] Allow to define other railtypes that should be introduced if a particular rail type is introduced, e.g. to make sure slow rail is introduced when fast rail gets introduced

This commit is contained in:
rubidium
2011-01-18 21:28:07 +00:00
parent 2f98ad38ba
commit dc94c94599
7 changed files with 34 additions and 13 deletions

View File

@@ -194,7 +194,7 @@ RailType GetBestRailtype(const CompanyID company)
RailTypes GetCompanyRailtypes(CompanyID company)
{
RailTypes rt = RAILTYPES_NONE;
RailTypes rts = RAILTYPES_NONE;
Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) {
@@ -206,12 +206,12 @@ RailTypes GetCompanyRailtypes(CompanyID company)
if (rvi->railveh_type != RAILVEH_WAGON) {
assert(rvi->railtype < RAILTYPE_END);
SetBit(rt, rvi->railtype);
rts |= GetRailTypeInfo(rvi->railtype)->introduces_railtypes;
}
}
}
return rt;
return rts;
}
RailType GetRailTypeByLabel(RailTypeLabel label)