summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-08-15 01:50:13 +0000
committerbelugas <belugas@openttd.org>2007-08-15 01:50:13 +0000
commit1b329b1bd9b9a9644468d55d9a37df4fc0ea024d (patch)
tree2bd35bf4dba04c2c9a0fe21c5700bfe9c48a67c9 /src
parentfafe33cdd2dfe8252501c7a7b824f8c36dd3c3a3 (diff)
downloadopenttd-1b329b1bd9b9a9644468d55d9a37df4fc0ea024d.tar.xz
(svn r10904) -Fix: When using a temporary industry, make sure you do not clear some unreachable tiles upon its destruction.
-Codechange: do not perform something that by all means will not change. A zero offset is really meaningless...
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_industrytiles.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index b81d71161..f3391c214 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -35,7 +35,7 @@ uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, Industry
byte tile_type;
bool is_same_industry;
- tile = GetNearbyTile(parameter, tile);
+ if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required
is_same_industry = (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == index);
tile_type = GetTerrainType(tile) << 2 | (IsTileType(tile, MP_WATER) ? 1 : 0) << 1 | (is_same_industry ? 1 : 0);
@@ -236,6 +236,7 @@ bool PerformIndustryTileSlopeCheck(TileIndex tile, const IndustryTileSpec *its,
{
Industry ind;
ind.xy = 0;
+ ind.width = 0;
ind.type = type;
uint16 callback_res = GetIndustryTileCallback(CBID_INDTILE_SHAPE_CHECK, 0, 0, gfx, &ind, tile);