|
@@ -296,36 +296,36 @@ char *GetGRFString(char *buff, uint16 st
|
|
|
{
|
|
|
const GRFText *default_text = NULL;
|
|
|
const GRFText *search_text;
|
|
|
|
|
|
assert(_grf_text[stringid].grfid != 0);
|
|
|
|
|
|
/* Remember this grfid in case the string has included text */
|
|
|
_last_grfid = _grf_text[stringid].grfid;
|
|
|
|
|
|
/*Search the list of lang-strings of this stringid for current lang */
|
|
|
for (search_text = _grf_text[stringid].textholder; search_text != NULL; search_text = search_text->next) {
|
|
|
if (search_text->langid == _currentLangID) {
|
|
|
return strecpy(buff, search_text->text, NULL);
|
|
|
return strecpy(buff, search_text->text, last);
|
|
|
}
|
|
|
|
|
|
/* If the current string is English or American, set it as the
|
|
|
* fallback language if the specific language isn't available. */
|
|
|
if (search_text->langid == GRFLX_ENGLISH || search_text->langid == GRFLX_AMERICAN) {
|
|
|
default_text = search_text;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* If there is a fallback string, return that */
|
|
|
if (default_text != NULL) return strecpy(buff, default_text->text, NULL);
|
|
|
if (default_text != NULL) return strecpy(buff, default_text->text, last);
|
|
|
|
|
|
/* Use the default string ID if the fallback string isn't available */
|
|
|
return GetString(buff, _grf_text[stringid].def_string, last);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Equivalence Setter function between game and newgrf langID.
|
|
|
* This function will adjust _currentLangID as to what is the LangID
|
|
|
* of the current language set by the user.
|
|
|
* The array iso_codes will be used to find that match.
|
|
|
* If not found, it will have to be standard english
|
|
|
* This function is called after the user changed language,
|