changeset 16822:2aa42d3a1228 draft

(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
author rubidium <rubidium@openttd.org>
date Tue, 21 Dec 2010 10:04:40 +0000
parents f557e79d1ba3
children 3a844b1791a9
files src/strings.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -940,9 +940,12 @@
 				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