mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Print warning instead of asserting for invalid NewGRF string IDs
This commit is contained in:
parent
ed0ffb6220
commit
d913083c37
@ -684,7 +684,14 @@ const char *GetDefaultLangGRFStringFromGRFText(const GRFTextWrapper &text)
|
||||
*/
|
||||
const char *GetGRFStringPtr(uint16 stringid)
|
||||
{
|
||||
#if 0
|
||||
assert_msg(_grf_text[stringid].grfid != 0, "stringid: %u", stringid);
|
||||
#endif
|
||||
|
||||
if (_grf_text[stringid].grfid == 0) {
|
||||
DEBUG(misc, 0, "Invalid NewGRF string ID: %d", stringid);
|
||||
return "(invalid StringID)";
|
||||
}
|
||||
|
||||
const char *str = GetGRFStringFromGRFText(_grf_text[stringid].textholder);
|
||||
if (str == nullptr) {
|
||||
|
Loading…
Reference in New Issue
Block a user