(svn r10962) -Codechange: protect yourself against an illicit substitution
authorbelugas
Wed, 22 Aug 2007 00:59:46 +0000
changeset 7461 09deed76b5d6
parent 7460 78e4e3c62f91
child 7462 74a281f80498
(svn r10962) -Codechange: protect yourself against an illicit substitution
src/industry_cmd.cpp
--- a/src/industry_cmd.cpp	Wed Aug 22 00:52:25 2007 +0000
+++ b/src/industry_cmd.cpp	Wed Aug 22 00:59:46 2007 +0000
@@ -274,9 +274,11 @@
 		} else {
 			/* No sprite group (or no valid one) found, meaning no graphics associated.
 			 * Use the substitute one instead */
-			gfx = indts->grf_prop.subst_id;
-			/* And point the industrytile spec accordingly */
-			indts = GetIndustryTileSpec(indts->grf_prop.subst_id);
+			if (indts->grf_prop.subst_id != INVALID_INDUSTRYTILE) {
+				gfx = indts->grf_prop.subst_id;
+				/* And point the industrytile spec accordingly */
+				indts = GetIndustryTileSpec(gfx);
+			}
 		}
 	}