diff options
author | rubidium <rubidium@openttd.org> | 2010-12-21 10:04:40 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-12-21 10:04:40 +0000 |
commit | ee87c91e0577346ac0a9f68ebe707509c59e0055 (patch) | |
tree | 4077274bd823ab2b7a454b49fc903699c9253a4d | |
parent | e1d62dc81b7288e58edd8b1cb800e519a3f7496d (diff) | |
download | openttd-ee87c91e0577346ac0a9f68ebe707509c59e0055.tar.xz |
(svn r21556) -Fix [FS#4320]: argt wasn't updated when argv was updated due to ARG_INDEX, so there was a mismatch between argt's offset and argv's offset causing trouble when getting the gender of a string
-rw-r--r-- | src/strings.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index 661afeec3..948ca5a42 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -940,9 +940,12 @@ static char *FormatString(char *buff, const char *str, int64 *argv, const int64 buff = FormatCommaNumber(buff, GetInt64(&argv, argve, &argt, SCC_COMMA), last); break; - case SCC_ARG_INDEX: // Move argument pointer - argv = argv_orig + (byte)*str++; + case SCC_ARG_INDEX: { // Move argument pointer + byte offset = (byte)*str++; + argv = argv_orig + offset; + if (argt_orig != NULL) argt = argt_orig + offset; break; + } case SCC_PLURAL_LIST: { // {P} int plural_form = *str++; // contains the plural form for this string |