Print warning instead of asserting for invalid NewGRF string IDs

This commit is contained in:
Jonathan G Rennison 2021-01-28 18:21:46 +00:00
parent ed0ffb6220
commit d913083c37

View File

@ -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) {