diff options
author | glx <glx@openttd.org> | 2007-09-19 17:37:44 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2007-09-19 17:37:44 +0000 |
commit | e9f9aa3d1cfa38ea470fd2b18ac7488c5421e6b1 (patch) | |
tree | c9caf5a578aa30baf1fb08c6d25826a3e6b19f64 /src/newgrf.cpp | |
parent | 5c9553d48bba3cfb8b65d56e82170d87cd1e08b3 (diff) | |
download | openttd-e9f9aa3d1cfa38ea470fd2b18ac7488c5421e6b1.tar.xz |
(svn r11129) -Fix: update some TextID to StringID 'translations' to reflect changes in language files
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 25066d2f3..d13b1c83f 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -253,17 +253,24 @@ static StringID MapGRFStringID(uint32 grfid, StringID str) if (GB(str, 8, 8) == 0xD0 || GB(str, 8, 8) == 0xDC) { return GetGRFStringID(grfid, str); } - +#define TEXID_TO_STRINGID(begin, end, stringid) if (str >= begin && str <= end) return str + (stringid - begin) /* We have some changes in our cargo strings, resulting in some missing. */ - if (str >= 0x006E && str <= 0x008D) return str - 0x20; - if (str >= 0x008E && str <= 0x00AD) return str - 0x20; + TEXID_TO_STRINGID(0x000E, 0x002D, STR_000E); + TEXID_TO_STRINGID(0x002E, 0x004D, STR_002E); + TEXID_TO_STRINGID(0x004E, 0x006D, STR_QUANTITY_NOTHING); + TEXID_TO_STRINGID(0x006E, 0x008D, STR_QUANTITY_NOTHING); + TEXID_TO_STRINGID(0x008E, 0x00AD, STR_ABBREV_NOTHING); /* Map building names according to our lang file changes * 0x200F = Tall Office Block, first house name in the original data, the one that TTDPatch stil uses * 0x201F = Old houses is the last house name. * OpenTTD does not have exactly the same order aymore, so, the code below allows * to compensate for the difference */ - if (str >= 0x200F && str <= 0x201F) return str + (STR_200F_TALL_OFFICE_BLOCK - 0x200F); + TEXID_TO_STRINGID(0x200F, 0x201F, STR_200F_TALL_OFFICE_BLOCK); + + /* Same thing for industries, since the introduction of 4 new strings above STR_482A_PRODUCTION_LAST_MONTH */ + TEXID_TO_STRINGID(0x482A, 0x483B, STR_482A_PRODUCTION_LAST_MONTH); +#undef TEXTID_TO_STRINGID return str; } |