mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 12:39:11 +00:00
Fix: Crash in GetGameStringPtr when there are no GS strings
This commit is contained in:
@@ -319,7 +319,7 @@ GameStrings *_current_data = nullptr;
|
||||
*/
|
||||
const char *GetGameStringPtr(uint id)
|
||||
{
|
||||
if (id >= _current_data->cur_language->lines.size()) return GetStringPtr(STR_UNDEFINED);
|
||||
if (_current_data == nullptr || _current_data->cur_language == nullptr || id >= _current_data->cur_language->lines.size()) return GetStringPtr(STR_UNDEFINED);
|
||||
return _current_data->cur_language->lines[id].c_str();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user