MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetCompanySettingFromName

Function GetCompanySettingFromName

src/settings.cpp:1709–1714  ·  view source on GitHub ↗

* Given a name of setting, return a company setting description of it. * @param name Name of the company setting to return a setting description of. * @return Pointer to the setting description of setting \a name if it can be found, * \c nullptr indicates failure to obtain the description. */

Source from the content-addressed store, hash-verified

1707 * \c nullptr indicates failure to obtain the description.
1708 */
1709static const SettingDesc *GetCompanySettingFromName(std::string_view name)
1710{
1711 static const std::string_view company_prefix = "company.";
1712 if (name.starts_with(company_prefix)) name.remove_prefix(company_prefix.size());
1713 return GetSettingFromName(name, _company_settings);
1714}
1715
1716/**
1717 * Given a name of any setting, return any setting description of it.

Callers 2

GetSettingFromNameFunction · 0.85
CmdChangeCompanySettingFunction · 0.85

Calls 2

GetSettingFromNameFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected