summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-08-22 00:59:46 +0000
committerbelugas <belugas@openttd.org>2007-08-22 00:59:46 +0000
commitb5627afcea5d177db133a96eb971407e0cd2f403 (patch)
tree1fc35dcf663ed54287475fa7674f655b081a0231 /src
parent116de48fdf097a35632a1dd0455afb80d1c12305 (diff)
downloadopenttd-b5627afcea5d177db133a96eb971407e0cd2f403.tar.xz
(svn r10962) -Codechange: protect yourself against an illicit substitution
Diffstat (limited to 'src')
-rw-r--r--src/industry_cmd.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index ce9e15ae8..07a3996f2 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -274,9 +274,11 @@ static void DrawTile_Industry(TileInfo *ti)
} 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);
+ }
}
}