Mercurial > hg > openttd
changeset 6133:49a563250135 draft
(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)
author | tron <tron@openttd.org> |
---|---|
date | Sat, 24 Feb 2007 06:46:20 +0000 |
parents | df7b080653c9 |
children | 7f92815712e4 |
files | src/rail_cmd.cpp src/road_cmd.cpp src/station_cmd.cpp src/town_cmd.cpp src/tree_cmd.cpp |
diffstat | 5 files changed, 0 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -553,7 +553,6 @@ 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;
--- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -518,8 +518,6 @@ 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 ||
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1747,15 +1747,11 @@ 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); }
--- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -350,8 +350,6 @@ 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 @@ { 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;