summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-08-24 00:23:35 +0000
committerbelugas <belugas@openttd.org>2007-08-24 00:23:35 +0000
commit40d4d2f2cabc3ba9a15294422f944690de0d5984 (patch)
tree4cbae99b4d2ec0b1c709d85ea814a81a94cbef54 /src/industry_cmd.cpp
parente9435c11b08664818f03aa747df373e7f8ff9cc4 (diff)
downloadopenttd-40d4d2f2cabc3ba9a15294422f944690de0d5984.tar.xz
(svn r10972) -Codechange: Implement the counterpart(GetTranslatedIndustryTileID) of getindustileid of TTDPatch. This allows to ensure that the ID of a tile (taken out of the map or not) is still a valid one regarding the possible override it may have been flagged to.
It is not the strict same thing, but is what we need regarding the slightly different approach we took for newindustries.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 28732cf75..1d5b2939d 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -328,7 +328,6 @@ static void GetAcceptedCargo_Industry(TileIndex tile, AcceptedCargo ac)
{
IndustryGfx gfx = GetIndustryGfx(tile);
const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);
- if (itspec->grf_prop.override != INVALID_INDUSTRYTILE) itspec = GetIndustryTileSpec(itspec->grf_prop.override);
/* When we have to use a callback, we put our data in the next two variables */
CargoID raw_accepts_cargo[lengthof(itspec->accepts_cargo)];
@@ -1180,14 +1179,15 @@ static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable
_error_message = STR_0239_SITE_UNSUITABLE;
do {
+ IndustryGfx gfx = GetTranslatedIndustryTileID(it->gfx);
TileIndex cur_tile = tile + ToTileIndexDiff(it->ti);
if (!IsValidTile(cur_tile)) {
- if (it->gfx == 0xff) continue;
+ if (gfx == 0xff) continue;
return false;
}
- if (it->gfx == 0xFF) {
+ if (gfx == 0xFF) {
if (!IsTileType(cur_tile, MP_WATER) ||
GetTileSlope(cur_tile, NULL) != SLOPE_FLAT) {
return false;
@@ -1201,7 +1201,7 @@ static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable
if (HASBIT(its->callback_flags, CBM_INDT_SHAPE_CHECK)) {
if (custom_shape_check != NULL) *custom_shape_check = true;
- if (!PerformIndustryTileSlopeCheck(cur_tile, its, type, it->gfx)) return false;
+ if (!PerformIndustryTileSlopeCheck(cur_tile, its, type, gfx)) return false;
} else {
if (ind_behav & INDUSTRYBEH_BUILT_ONWATER) {
/* As soon as the tile is not water, bail out.