(svn r8875) -Fix

Remove unnecessary EnsureNoVehicle() checks because they are
- pointless per se (f.e. there are no vehicles on house tiles)
- done again (f.e. using CMD_LANDSCAPE_CLEAR just a few lines later)
This commit is contained in:
tron 2007-02-24 06:46:20 +00:00
parent 029ceda0f1
commit 1d1121f85a
5 changed files with 0 additions and 13 deletions

View File

@ -553,7 +553,6 @@ int32 CmdBuildTrainDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
/* check railtype and valid direction for depot (0 through 3), 4 in total */
if (!ValParamRailtype(p1) || p2 > 3) return CMD_ERROR;

View File

@ -518,8 +518,6 @@ int32 CmdBuildRoadDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (p1 > 3) return CMD_ERROR; // check direction
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
tileh = GetTileSlope(tile, NULL);
if (tileh != SLOPE_FLAT && (
!_patches.build_on_slopes ||

View File

@ -1747,15 +1747,11 @@ int32 CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR;
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(cost)) return CMD_ERROR;
TileIndex tile_cur = tile + TileOffsByDiagDir(direction);
if (!EnsureNoVehicle(tile_cur)) return CMD_ERROR;
if (!IsTileType(tile_cur, MP_WATER) || GetTileSlope(tile_cur, NULL) != SLOPE_FLAT) {
return_cmd_error(STR_304B_SITE_UNSUITABLE);
}

View File

@ -350,8 +350,6 @@ static int32 ClearTile_Town(TileIndex tile, byte flags)
int32 cost;
Town *t;
// safety checks
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
if (flags&DC_AUTO && !(flags&DC_AI_BUILDING)) return_cmd_error(STR_2004_BUILDING_MUST_BE_DEMOLISHED);
house = GetHouseType(tile);
@ -1303,8 +1301,6 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
{
int32 r;
// make sure it's possible
if (!EnsureNoVehicle(tile)) return false;
if (IsSteepSlope(GetTileSlope(tile, NULL))) return false;
if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return false;

View File

@ -237,8 +237,6 @@ int32 CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
for (y = sy; y <= ey; y++) {
TileIndex tile = TileXY(x, y);
if (!EnsureNoVehicle(tile)) continue;
switch (GetTileType(tile)) {
case MP_TREES:
// no more space for trees?