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

Function GetLanguage

src/strings.cpp:2184–2191  ·  view source on GitHub ↗

* Get the language with the given NewGRF language ID. * @param newgrflangid NewGRF languages ID to check. * @return The language's metadata, or nullptr if it is not known. */

Source from the content-addressed store, hash-verified

2182 * @return The language's metadata, or nullptr if it is not known.
2183 */
2184const LanguageMetadata *GetLanguage(uint8_t newgrflangid)
2185{
2186 for (const LanguageMetadata &lang : _languages) {
2187 if (newgrflangid == lang.newgrflangid) return ⟨
2188 }
2189
2190 return nullptr;
2191}
2192
2193/**
2194 * Reads the language file header and checks compatibility.

Callers 2

FillLanguageListFunction · 0.85
GlobalVarChangeInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected