summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-11-17 22:33:53 +0000
committerglx <glx@openttd.org>2007-11-17 22:33:53 +0000
commit32202be4528f18fbe7eaa03bf2585f5fd8179882 (patch)
tree865a621b9d64bd89560fc372c452629466582fc0 /src
parent7305a1f1fe4099a7b34e4f19356b775d1b5628b4 (diff)
downloadopenttd-32202be4528f18fbe7eaa03bf2585f5fd8179882.tar.xz
(svn r11453) -Fix (r11450): unrevert r11239, as we now need it
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index c2a9e3a18..80f5bddb1 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -1791,7 +1791,7 @@ static bool IndustrytilesChangeInfo(uint indtid, int numinfo, int prop, byte **b
case 0x0B:
case 0x0C: {
uint16 acctp = grf_load_word(&buf);
- tsp->accepts_cargo[prop - 0x0A] = GetCargoTranslation(GB(acctp, 0, 8), _cur_grffile);
+ tsp->accepts_cargo[prop - 0x0A] = GB(acctp, 0, 8);
tsp->acceptance[prop - 0x0A] = GB(acctp, 8, 8);
} break;
@@ -1991,13 +1991,13 @@ static bool IndustriesChangeInfo(uint indid, int numinfo, int prop, byte **bufp,
case 0x10: // Production cargo types
for (byte j = 0; j < 2; j++) {
- indsp->produced_cargo[j] = GetCargoTranslation(grf_load_byte(&buf), _cur_grffile);
+ indsp->produced_cargo[j] = grf_load_byte(&buf);
}
break;
case 0x11: // Acceptance cargo types
for (byte j = 0; j < 3; j++) {
- indsp->accepts_cargo[j] = GetCargoTranslation(grf_load_byte(&buf), _cur_grffile);
+ indsp->accepts_cargo[j] = grf_load_byte(&buf);
}
grf_load_byte(&buf); // Unnused, eat it up
break;
@@ -5314,6 +5314,15 @@ static void FinaliseIndustriesArray()
strid = GetGRFStringID(indsp->grf_prop.grffile->grfid, indsp->new_industry_text);
if (strid != STR_UNDEFINED) indsp->new_industry_text = strid;
+ for (byte j = 0; j < 2; j++) {
+ CargoID c = GetCargoTranslation(indsp->produced_cargo[j], indsp->grf_prop.grffile);
+ indsp->produced_cargo[j] = c;
+ }
+ for (byte j = 0; j < 3; j++) {
+ CargoID c = GetCargoTranslation(indsp->accepts_cargo[j], indsp->grf_prop.grffile);
+ indsp->accepts_cargo[j] = c;
+ }
+
_industry_mngr.SetEntitySpec(indsp);
_loaded_newgrf_features.has_newindustries = true;
}
@@ -5324,6 +5333,10 @@ static void FinaliseIndustriesArray()
for (int i = 0; i < NUM_INDUSTRYTILES; i++) {
IndustryTileSpec *indtsp = file->indtspec[i];
if (indtsp != NULL) {
+ for (byte j = 0; j < 3; j++) {
+ CargoID c = GetCargoTranslation(indtsp->accepts_cargo[j], indtsp->grf_prop.grffile);
+ indtsp->accepts_cargo[j] = c;
+ }
_industile_mngr.SetEntitySpec(indtsp);
}
}