summaryrefslogtreecommitdiff
path: root/src/unmovable_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-26 16:51:10 +0000
committerrubidium <rubidium@openttd.org>2007-07-26 16:51:10 +0000
commitd624f66c794109a22787685a3aa53d6cf35a02ba (patch)
tree4b6a986aa841f12efff161e45aacd1a023cff71d /src/unmovable_cmd.cpp
parent5bd241eb5b151dd9a5ebda0a93aff8740713ce62 (diff)
downloadopenttd-d624f66c794109a22787685a3aa53d6cf35a02ba.tar.xz
(svn r10698) -Codechange [FS#1082]: simplify the code related to foundations. Primarily removal of (duplicated|magic) code and introduction of few helper functions to ease foundation determination. Patch by frosch.
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r--src/unmovable_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index 877e89b19..079e46d07 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -118,7 +118,7 @@ static void DrawTile_Unmovable(TileInfo *ti)
case UNMOVABLE_LIGHTHOUSE: {
const DrawTileUnmovableStruct* dtus;
- if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh);
+ if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
DrawClearLandTile(ti, 2);
dtus = &_draw_tile_unmovable_data[GetUnmovableType(ti->tile)];
@@ -153,7 +153,7 @@ static void DrawTile_Unmovable(TileInfo *ti)
SpriteID palette;
assert(IsCompanyHQ(ti->tile));
- if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh);
+ if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
palette = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
@@ -186,9 +186,9 @@ static uint GetSlopeZ_Unmovable(TileIndex tile, uint x, uint y)
}
}
-static Slope GetSlopeTileh_Unmovable(TileIndex tile, Slope tileh)
+static Foundation GetFoundation_Unmovable(TileIndex tile, Slope tileh)
{
- return IsOwnedLand(tile) ? tileh : SLOPE_FLAT;
+ return IsOwnedLand(tile) ? FOUNDATION_NONE : FlatteningFoundation(tileh);
}
static CommandCost ClearTile_Unmovable(TileIndex tile, byte flags)
@@ -411,5 +411,5 @@ extern const TileTypeProcs _tile_type_unmovable_procs = {
ChangeTileOwner_Unmovable, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
- GetSlopeTileh_Unmovable, /* get_slope_tileh_proc */
+ GetFoundation_Unmovable, /* get_foundation_proc */
};