1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 01:49:10 +00:00

Fix: Setting the default railtype to 'first/last available' did not work with NewGRF defined railtypes.

This commit is contained in:
frosch
2019-12-18 00:48:03 +01:00
committed by Charles Pigott
parent 6fa217dfc8
commit b769eb30c4
3 changed files with 10 additions and 23 deletions

View File

@@ -208,21 +208,6 @@ bool ValParamRailtype(const RailType rail)
return rail < RAILTYPE_END && HasRailtypeAvail(_current_company, rail);
}
/**
* Returns the "best" railtype a company can build.
* As the AI doesn't know what the BEST one is, we have our own priority list
* here. When adding new railtypes, modify this function
* @param company the company "in action"
* @return The "best" railtype a company has available
*/
RailType GetBestRailtype(const CompanyID company)
{
if (HasRailtypeAvail(company, RAILTYPE_MAGLEV)) return RAILTYPE_MAGLEV;
if (HasRailtypeAvail(company, RAILTYPE_MONO)) return RAILTYPE_MONO;
if (HasRailtypeAvail(company, RAILTYPE_ELECTRIC)) return RAILTYPE_ELECTRIC;
return RAILTYPE_RAIL;
}
/**
* Add the rail types that are to be introduced at the given date.
* @param current The currently available railtypes.