summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-01 19:42:51 +0000
committerrubidium <rubidium@openttd.org>2011-12-01 19:42:51 +0000
commit42c92be121d406e70a0431ab0dacc7f6934ee9a5 (patch)
tree9e4e10c2daa12db2e75361e9a1aa04bbfc8792bc
parent23ab60437cf08e8acca0e686773c2ce3c12d63cc (diff)
downloadopenttd-42c92be121d406e70a0431ab0dacc7f6934ee9a5.tar.xz
(svn r23391) -Feature: [NewGRF] Allow translating multiple languages with Action 13 in GRFv8
-rw-r--r--src/newgrf.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 2d9006345..5a2175737 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -7016,6 +7016,12 @@ static void TranslateGRFStrings(ByteReader *buf)
return;
}
+ /* Since no language id is supplied for with version 7 and lower NewGRFs, this string has
+ * to be added as a generic string, thus the language id of 0x7F. For this to work
+ * new_scheme has to be true as well, which will also be implicitly the case for version 8
+ * and higher. A language id of 0x7F will be overridden by a non-generic id, so this will
+ * not change anything if a string has been provided specifically for this language. */
+ byte language = _cur.grffile->grf_version >= 8 ? buf->ReadByte() : 0x7F;
byte num_strings = buf->ReadByte();
uint16 first_id = buf->ReadWord();
@@ -7032,12 +7038,7 @@ static void TranslateGRFStrings(ByteReader *buf)
continue;
}
- /* Since no language id is supplied this string has to be added as a
- * generic string, thus the language id of 0x7F. For this to work
- * new_scheme has to be true as well. A language id of 0x7F will be
- * overridden by a non-generic id, so this will not change anything if
- * a string has been provided specifically for this language. */
- AddGRFString(grfid, first_id + i, 0x7F, true, true, string, STR_UNDEFINED);
+ AddGRFString(grfid, first_id + i, language, true, true, string, STR_UNDEFINED);
}
}