# HG changeset patch # User yexo # Date 2011-10-14 16:51:30 # Node ID 59b53cc8b5fd26da6f8c8a5de68c219024d5458f # Parent cd6bf8068f4716fd8470c87fab8df55645490203 (svn r23029) -Fix: [NewGRF] support for cases in strings was broken diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -528,7 +528,7 @@ char *TranslateTTDPatchCodes(uint32 grfi 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; } diff --git a/src/strings.cpp b/src/strings.cpp --- a/src/strings.cpp +++ b/src/strings.cpp @@ -715,6 +715,8 @@ static char *FormatString(char *buff, co 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; }