summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-13 10:58:41 +0000
committerrubidium <rubidium@openttd.org>2009-09-13 10:58:41 +0000
commitd0836f9ec81082ad8807eb5617ebbef343edcf88 (patch)
tree6b81838b50e17f258bed4beb81e677e665987670
parent50e424ba241044851fb647c00b5de55848c8db76 (diff)
downloadopenttd-d0836f9ec81082ad8807eb5617ebbef343edcf88.tar.xz
(svn r17521) -Change: don't assume that there is always 'another' industry tile after two '0x18' industry tiles
-rw-r--r--src/industry_cmd.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 05e9cb1b7..b31b82e3f 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -729,9 +729,19 @@ static void MakeIndustryTileBigger(TileIndex tile)
CreateChimneySmoke(tile);
break;
- case GFX_OILRIG_1:
- if (GetIndustryGfx(tile + TileDiffXY(0, 1)) == GFX_OILRIG_1) BuildOilRig(tile);
- break;
+ case GFX_OILRIG_1: {
+ /* Do not require an industry tile to be after the first two GFX_OILRIG_1
+ * tiles (like the default oil rig). Do a proper check to ensure the
+ * tiles belong to the same industry and based on that build the oil rig's
+ * station. */
+ TileIndex other = tile + TileDiffXY(0, 1);
+
+ if (IsTileType(other, MP_INDUSTRY) &&
+ GetIndustryGfx(other) == GFX_OILRIG_1 &&
+ GetIndustryIndex(tile) == GetIndustryIndex(other)) {
+ BuildOilRig(tile);
+ }
+ } break;
case GFX_TOY_FACTORY:
case GFX_BUBBLE_CATCHER: