diff options
author | tron <tron@openttd.org> | 2007-02-24 06:46:20 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2007-02-24 06:46:20 +0000 |
commit | 1d1121f85a975a6b9ed8305c154fc39f4f5db7fd (patch) | |
tree | dc9610214fcd9e5497b8289fdb59c506a6007a31 | |
parent | 029ceda0f1c2f11231a0662cc45057f8452f645a (diff) | |
download | openttd-1d1121f85a975a6b9ed8305c154fc39f4f5db7fd.tar.xz |
(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)
-rw-r--r-- | src/rail_cmd.cpp | 1 | ||||
-rw-r--r-- | src/road_cmd.cpp | 2 | ||||
-rw-r--r-- | src/station_cmd.cpp | 4 | ||||
-rw-r--r-- | src/town_cmd.cpp | 4 | ||||
-rw-r--r-- | src/tree_cmd.cpp | 2 |
5 files changed, 0 insertions, 13 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 437d19463..d74b30096 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -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; diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index d10639986..73b255096 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -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 || diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 19ba9787e..f60e60ec1 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -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); } diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index dd5da52fe..88880040e 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -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; diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 3121a5b2a..7ce4987ee 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -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? |