changeset 18200:4da6f6ff6a67 draft

(svn r23029) -Fix: [NewGRF] support for cases in strings was broken
author yexo <yexo@openttd.org>
date Fri, 14 Oct 2011 16:51:30 +0000
parents 728c09f456b3
children fbfc95479140
files src/newgrf_text.cpp src/strings.cpp
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -528,7 +528,7 @@
 						int mapped = lm != NULL ? lm->GetMapping(index, code == 0x0E) : -1;
 						if (mapped >= 0) {
 							d += Utf8Encode(d, code == 0x0E ? SCC_GENDER_INDEX : SCC_SETCASE);
-							d += Utf8Encode(d, mapped);
+							d += Utf8Encode(d, code == 0x0E ? mapped : mapped + 1);
 						}
 						break;
 					}
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -715,6 +715,8 @@
 			case SCC_NEWGRF_PRINT_WORD_STRING_ID: {
 				StringID substr = args->GetInt32(SCC_NEWGRF_PRINT_WORD_STRING_ID);
 				str_stack.push(GetStringPtr(substr));
+				casei = modifier >> 24;
+				modifier = 0;
 				break;
 			}