diff options
author | rubidium <rubidium@openttd.org> | 2011-11-04 10:22:27 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-04 10:22:27 +0000 |
commit | 2ed0f93bfbd27ba4b4dc3e590556ffae6d9b9338 (patch) | |
tree | 9086d7e7b83871e60d43d838fd5f005ef50c5063 /src/object_cmd.cpp | |
parent | a36551dbb4a6aa8a10e99df8331ac4ecb8586270 (diff) | |
download | openttd-2ed0f93bfbd27ba4b4dc3e590556ffae6d9b9338.tar.xz |
(svn r23093) -Codechange: add a default NULL for the Z of GetTileSlope and use it
Diffstat (limited to 'src/object_cmd.cpp')
-rw-r--r-- | src/object_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index bd36e48c9..93d53898d 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -236,7 +236,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 uint16 callback = CALLBACK_FAILED; if (HasBit(spec->callback_mask, CBM_OBJ_SLOPE_CHECK)) { TileIndex diff = t - tile; - callback = GetObjectCallback(CBID_OBJECT_LAND_SLOPE_CHECK, GetTilePixelSlope(t, NULL), TileY(diff) << 4 | TileX(diff), spec, NULL, t, view); + callback = GetObjectCallback(CBID_OBJECT_LAND_SLOPE_CHECK, GetTileSlope(t), TileY(diff) << 4 | TileX(diff), spec, NULL, t, view); } if (callback == CALLBACK_FAILED) { @@ -276,7 +276,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 switch (type) { case OBJECT_TRANSMITTER: case OBJECT_LIGHTHOUSE: - if (GetTilePixelSlope(tile, NULL) != SLOPE_FLAT) return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED); + if (GetTileSlope(tile) != SLOPE_FLAT) return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED); break; case OBJECT_OWNED_LAND: @@ -731,7 +731,7 @@ static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, uin * - Allow autoslope by default. * - Disallow autoslope if callback succeeds and returns non-zero. */ - Slope tileh_old = GetTilePixelSlope(tile, NULL); + Slope tileh_old = GetTileSlope(tile); /* TileMaxZ must not be changed. Slopes must not be steep. */ if (!IsSteepSlope(tileh_old) && !IsSteepSlope(tileh_new) && (GetTileMaxPixelZ(tile) == z_new + GetSlopeMaxPixelZ(tileh_new))) { const ObjectSpec *spec = ObjectSpec::Get(type); |