From fb8973c64ae4f1fe0789f4968a2f90b068d6ee07 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 29 Jan 2008 17:09:00 +0000 Subject: (svn r12015) -Fix [FS#1716] (Revert r11422): Patch in FS#1430 avoided instead of fixed the problem. GetStringWithArgs() discards information that SCC_GENDER_LIST needs to work. Now use pointers to retrieve GRF strings, so that GetStringPtr() will work correctly. This is advantageous as now no buffer copy is made when using all GRF strings. --- src/newgrf_text.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/newgrf_text.cpp') diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index 870ad5021..07d1c8323 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -405,7 +405,7 @@ StringID GetGRFStringID(uint32 grfid, uint16 stringid) } -char *GetGRFString(char *buff, uint16 stringid, const char* last) +const char *GetGRFStringPtr(uint16 stringid) { const GRFText *default_text = NULL; const GRFText *search_text; @@ -418,7 +418,7 @@ char *GetGRFString(char *buff, uint16 stringid, const char* last) /*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, last); + return search_text->text; } /* If the current string is English or American, set it as the @@ -429,10 +429,10 @@ char *GetGRFString(char *buff, uint16 stringid, const char* last) } /* If there is a fallback string, return that */ - if (default_text != NULL) return strecpy(buff, default_text->text, last); + if (default_text != NULL) return default_text->text; /* Use the default string ID if the fallback string isn't available */ - return GetString(buff, _grf_text[stringid].def_string, last); + return GetStringPtr(_grf_text[stringid].def_string); } /** -- cgit v1.2.3-54-g00ecf