summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-08-10 11:11:11 +0000
committerrubidium <rubidium@openttd.org>2009-08-10 11:11:11 +0000
commitb8954b84bdb236a395b849edb9b1276d15b183a0 (patch)
tree266b1b31f41978afd605b819db8b3d5ed72a94a0
parent40a8bd556e7daa65c3e63059b871f85c8ffce072 (diff)
downloadopenttd-b8954b84bdb236a395b849edb9b1276d15b183a0.tar.xz
(svn r17143) -Fix [FS#3097]: NewGRFs sometimes got the wrong string causing crashes later on
-rw-r--r--src/newgrf.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index e8a384c97..eca778dca 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -303,8 +303,19 @@ StringID MapGRFStringID(uint32 grfid, StringID str)
TEXID_TO_STRINGID(0x2036, 0x2041, STR_TOWN_BUILDING_NAME_COTTAGES_1);
TEXID_TO_STRINGID(0x2059, 0x205C, STR_TOWN_BUILDING_NAME_IGLOO_1);
- /* Same thing for industries, since the introduction of 4 new strings above STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE */
- TEXID_TO_STRINGID(0x482A, 0x483B, STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE);
+ /* Same thing for industries */
+ TEXID_TO_STRINGID(0x4802, 0x4826, STR_INDUSTRY_NAME_COAL_MINE);
+ TEXID_TO_STRINGID(0x4827, 0x4829, STR_INDUSTRY_VIEW_REQUIRES_CARGO);
+ TEXID_TO_STRINGID(0x482D, 0x482E, STR_NEWS_INDUSTRY_CONSTRUCTION);
+ TEXID_TO_STRINGID(0x4832, 0x4834, STR_NEWS_INDUSTRY_CLOSURE_GENERAL);
+ TEXID_TO_STRINGID(0x4835, 0x4838, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL);
+ TEXID_TO_STRINGID(0x4839, 0x483A, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL);
+
+ switch (str) {
+ case 0x4830: return STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY;
+ case 0x4831: return STR_ERROR_FOREST_CAN_ONLY_BE_PLANTED;
+ case 0x483B: return STR_ERROR_CAN_ONLY_BE_POSITIONED;
+ }
#undef TEXTID_TO_STRINGID
if (str == STR_NULL) return STR_EMPTY;