src/industry_cmd.cpp
changeset 7335 141c6b86ec1f
parent 7334 ed9a43cf642a
child 7337 b6b77a60343a
--- a/src/industry_cmd.cpp	Thu Jul 26 15:37:19 2007 +0000
+++ b/src/industry_cmd.cpp	Thu Jul 26 16:51:10 2007 +0000
@@ -255,7 +255,6 @@
 	Industry *ind = GetIndustryByTile(ti->tile);
 	const IndustryTileSpec *indts = GetIndustryTileSpec(gfx);
 	const DrawBuildingsTileStruct *dits;
-	byte z;
 	SpriteID image;
 	SpriteID pal;
 
@@ -287,12 +286,8 @@
 		pal = dits->ground.pal;
 	}
 
-	z = ti->z;
-	/* Add bricks below the industry? */
-	if (ti->tileh != SLOPE_FLAT) {
-		DrawFoundation(ti, ti->tileh);
-		z += TILE_HEIGHT;
-	}
+	/* DrawFoundation() modifes ti->z and ti->tileh */
+	if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
 
 	DrawGroundSprite(image, pal);
 
@@ -306,7 +301,7 @@
 			dits->width  + 1,
 			dits->height + 1,
 			dits->dz,
-			z,
+			ti->z,
 			HASBIT(_transparent_opt, TO_INDUSTRIES));
 
 		if (HASBIT(_transparent_opt, TO_INDUSTRIES)) return;
@@ -323,9 +318,9 @@
 	return GetTileMaxZ(tile);
 }
 
-static Slope GetSlopeTileh_Industry(TileIndex tile, Slope tileh)
+static Foundation GetFoundation_Industry(TileIndex tile, Slope tileh)
 {
-	return SLOPE_FLAT;
+	return FlatteningFoundation(tileh);
 }
 
 static void GetAcceptedCargo_Industry(TileIndex tile, AcceptedCargo ac)
@@ -1995,7 +1990,7 @@
 	ChangeTileOwner_Industry,    /* change_tile_owner_proc */
 	GetProducedCargo_Industry,   /* get_produced_cargo_proc */
 	NULL,                        /* vehicle_enter_tile_proc */
-	GetSlopeTileh_Industry,      /* get_slope_tileh_proc */
+	GetFoundation_Industry,      /* get_foundation_proc */
 };
 
 static const SaveLoad _industry_desc[] = {