From 6d8e048d96383efc556cc4764c028ca6fc86164e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 16 Jan 2016 18:38:13 +0100 Subject: [PATCH] Fall-back to default language in case none is set From thread https://openrct2.org/forums/topic/720-openrct2-doesnt-work/, the object http://www.nedesigns.com/rct2-object/5130/scgletrs/ does not set `pString` properly, so use a default fallback in such case. --- src/localisation/language.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/localisation/language.cpp b/src/localisation/language.cpp index 92f4780269..5994c8b15e 100644 --- a/src/localisation/language.cpp +++ b/src/localisation/language.cpp @@ -346,6 +346,11 @@ rct_string_id object_get_localised_text(uint8_t** pStringTable/*ebp*/, int type/ // Skip over the actual string entry to get to the next entry while (*(*pStringTable)++ != 0); } + // Fall back in case language does not get set. + if (pString == NULL) + { + pString = (char*)(*pStringTable); + } char name[9]; if (RCT2_GLOBAL(0x009ADAFC, uint8) == 0) {