forked from mirror/OpenTTD
(svn r7323) -Fix (r7182): When translating NewGRF strings, look at the first
character and move ahead if needed, instead of taking the first character and moving back.
This commit is contained in:
@@ -159,13 +159,13 @@ static char *TranslateTTDPatchCodes(const char *str)
|
|||||||
char *tmp = malloc(strlen(str) * 10 + 1); /* Allocate space to allow for expansion */
|
char *tmp = malloc(strlen(str) * 10 + 1); /* Allocate space to allow for expansion */
|
||||||
char *d = tmp;
|
char *d = tmp;
|
||||||
bool unicode = false;
|
bool unicode = false;
|
||||||
WChar c = Utf8Consume(&str);
|
WChar c;
|
||||||
|
size_t len = Utf8Decode(&c, str);
|
||||||
|
|
||||||
if (c == 0x00DE) {
|
if (c == 0x00DE) {
|
||||||
/* The thorn ('þ') indicates a unicode string to TTDPatch */
|
/* The thorn ('þ') indicates a unicode string to TTDPatch */
|
||||||
unicode = true;
|
unicode = true;
|
||||||
} else {
|
str += len;
|
||||||
str--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
Reference in New Issue
Block a user