(svn r11544) -Fix [FS#1501]: revert r11453 as it translated cargo when it should not
authorglx
Sat, 01 Dec 2007 02:47:10 +0000
changeset 7988 fa2cce262aa9
parent 7987 aa9239ef92f6
child 7989 2b4dc1946521
(svn r11544) -Fix [FS#1501]: revert r11453 as it translated cargo when it should not
src/newgrf.cpp
--- a/src/newgrf.cpp	Sat Dec 01 01:31:05 2007 +0000
+++ b/src/newgrf.cpp	Sat Dec 01 02:47:10 2007 +0000
@@ -1791,7 +1791,7 @@
 			case 0x0B:
 			case 0x0C: {
 				uint16 acctp = grf_load_word(&buf);
-				tsp->accepts_cargo[prop - 0x0A] = GB(acctp, 0, 8);
+				tsp->accepts_cargo[prop - 0x0A] = GetCargoTranslation(GB(acctp, 0, 8), _cur_grffile);
 				tsp->acceptance[prop - 0x0A] = GB(acctp, 8, 8);
 			} break;
 
@@ -1991,13 +1991,13 @@
 
 			case 0x10: // Production cargo types
 				for (byte j = 0; j < 2; j++) {
-					indsp->produced_cargo[j] = grf_load_byte(&buf);
+					indsp->produced_cargo[j] = GetCargoTranslation(grf_load_byte(&buf), _cur_grffile);
 				}
 				break;
 
 			case 0x11: // Acceptance cargo types
 				for (byte j = 0; j < 3; j++) {
-					indsp->accepts_cargo[j] = grf_load_byte(&buf);
+					indsp->accepts_cargo[j] = GetCargoTranslation(grf_load_byte(&buf), _cur_grffile);
 				}
 				grf_load_byte(&buf); // Unnused, eat it up
 				break;
@@ -5327,15 +5327,6 @@
 					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;
 				}
@@ -5346,10 +5337,6 @@
 			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);
 				}
 			}