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

Function GetGameStringPtr

src/game/game_text.cpp:315–319  ·  view source on GitHub ↗

* Get the string pointer of a particular game string. * @param id The ID of the game string. * @return The encoded string. */

Source from the content-addressed store, hash-verified

313 * @return The encoded string.
314 */
315std::string_view GetGameStringPtr(StringIndexInTab id)
316{
317 if (_current_gamestrings_data == nullptr || _current_gamestrings_data->cur_language == nullptr || id.base() >= _current_gamestrings_data->cur_language->lines.size()) return GetStringPtr(STR_UNDEFINED);
318 return _current_gamestrings_data->cur_language->lines[id];
319}
320
321/**
322 * Get the string parameters of a particular game string.

Callers 2

GetStringPtrFunction · 0.85
GetStringWithArgsFunction · 0.85

Calls 3

GetStringPtrFunction · 0.85
baseMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected