diff src/station_cmd.cpp @ 7645:5178857fa331 draft

(svn r11176) -Revert (r9867): as it is needed for newgrf callbacks 14B and 14C
author glx <glx@openttd.org>
date Thu, 27 Sep 2007 21:39:13 +0000
parents 610b2a5d634a
children 58283aa94bde
line wrap: on
line diff
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -165,14 +165,14 @@
 	/* No industry */
 	if (!IsTileType(tile, MP_INDUSTRY)) return false;
 
-	const IndustrySpec *indsp = GetIndustrySpec(GetIndustryByTile(tile)->type);
+	const Industry *ind = GetIndustryByTile(tile);
 
 	/* No extractive industry */
-	if ((indsp->life_type & INDUSTRYLIFE_EXTRACTIVE) == 0) return false;
-
-	for (uint i = 0; i < lengthof(indsp->produced_cargo); i++) {
+	if ((GetIndustrySpec(ind->type)->life_type & INDUSTRYLIFE_EXTRACTIVE) == 0) return false;
+
+	for (uint i = 0; i < lengthof(ind->produced_cargo); i++) {
 		/* The industry extracts something non-liquid, i.e. no oil or plastic, so it is a mine */
-		if (indsp->produced_cargo[i] != CT_INVALID && (GetCargo(indsp->produced_cargo[i])->classes & CC_LIQUID) == 0) return true;
+		if (ind->produced_cargo[i] != CT_INVALID && (GetCargo(ind->produced_cargo[i])->classes & CC_LIQUID) == 0) return true;
 	}
 
 	return false;
@@ -208,14 +208,14 @@
 	/* No industry */
 	if (!IsTileType(tile, MP_INDUSTRY)) return false;
 
-	const IndustrySpec *indsp = GetIndustrySpec(GetIndustryByTile(tile)->type);
+	const Industry *ind = GetIndustryByTile(tile);
 
 	/* No extractive industry */
-	if ((indsp->life_type & INDUSTRYLIFE_ORGANIC) == 0) return false;
-
-	for (uint i = 0; i < lengthof(indsp->produced_cargo); i++) {
+	if ((GetIndustrySpec(ind->type)->life_type & INDUSTRYLIFE_ORGANIC) == 0) return false;
+
+	for (uint i = 0; i < lengthof(ind->produced_cargo); i++) {
 		/* The industry produces wood. */
-		if (indsp->produced_cargo[i] != CT_INVALID && GetCargo(indsp->produced_cargo[i])->label == 'WOOD') return true;
+		if (ind->produced_cargo[i] != CT_INVALID && GetCargo(ind->produced_cargo[i])->label == 'WOOD') return true;
 	}
 
 	return false;