Return failure when encountering unknown lang code, fixes #3524 (#3579)

This commit is contained in:
Michael Steenbeek 2016-05-12 21:48:40 +02:00 committed by Ted John
parent 774bbdcbe8
commit 9fac7f38a5
2 changed files with 5 additions and 5 deletions

View File

@ -149,7 +149,7 @@ const char *language_get_string(rct_string_id id)
}
}
int language_open(int id)
bool language_open(int id)
{
static const char *languagePath = "%s/language/%s.txt";
char filename[MAX_PATH];
@ -157,7 +157,7 @@ int language_open(int id)
language_close_all();
if (id == LANGUAGE_UNDEFINED)
return 1;
return false;
platform_get_openrct_data_path(dataPath);
if (id != LANGUAGE_ENGLISH_UK) {
@ -213,14 +213,14 @@ int language_open(int id)
log_warning("Falling back to sprite font.");
gUseTrueTypeFont = false;
gCurrentTTFFontSet = nullptr;
return 0;
return false;
}
}
// Objects and their localized strings need to be refreshed
reset_loaded_objects();
return 1;
return true;
}
return 0;

View File

@ -65,7 +65,7 @@ extern const utf8 BlackRightArrowString[];
extern const utf8 CheckBoxMarkString[];
const char *language_get_string(rct_string_id id);
int language_open(int id);
bool language_open(int id);
void language_close_all();
rct_string_id object_get_localised_text(uint8_t** pStringTable/*ebp*/, int type/*ecx*/, int index/*ebx*/, int tableindex/*edx*/);