summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authorYexo <yexo@openttd.org>2009-01-21 02:31:55 +0000
committerYexo <yexo@openttd.org>2009-01-21 02:31:55 +0000
commitdb3ee34b4468aa3448b64e339258760885c5d716 (patch)
tree272533ac91b7bc3ab16c3ee1a997e142f3170a2a /src/ai/api
parent5e7669b539002cb9ec9e608f4601a827b5e9da57 (diff)
downloadopenttd-db3ee34b4468aa3448b64e339258760885c5d716.tar.xz
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_tile.cpp8
-rw-r--r--src/ai/api/ai_tile.hpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/ai/api/ai_tile.cpp b/src/ai/api/ai_tile.cpp
index a1f16b9bd..6426c9374 100644
--- a/src/ai/api/ai_tile.cpp
+++ b/src/ai/api/ai_tile.cpp
@@ -190,22 +190,22 @@
/* static */ bool AITile::RaiseTile(TileIndex tile, int32 slope)
{
- EnforcePrecondition(false, ::IsValidTile(tile));
+ EnforcePrecondition(false, tile < ::MapSize());
return AIObject::DoCommand(tile, slope, 1, CMD_TERRAFORM_LAND);
}
/* static */ bool AITile::LowerTile(TileIndex tile, int32 slope)
{
- EnforcePrecondition(false, ::IsValidTile(tile));
+ EnforcePrecondition(false, tile < ::MapSize());
return AIObject::DoCommand(tile, slope, 0, CMD_TERRAFORM_LAND);
}
/* static */ bool AITile::LevelTiles(TileIndex start_tile, TileIndex end_tile)
{
- EnforcePrecondition(false, ::IsValidTile(start_tile));
- EnforcePrecondition(false, ::IsValidTile(end_tile));
+ EnforcePrecondition(false, start_tile < ::MapSize());
+ EnforcePrecondition(false, end_tile < ::MapSize());
return AIObject::DoCommand(end_tile, start_tile, 0, CMD_LEVEL_LAND);
}
diff --git a/src/ai/api/ai_tile.hpp b/src/ai/api/ai_tile.hpp
index 9a4df1677..576bacf07 100644
--- a/src/ai/api/ai_tile.hpp
+++ b/src/ai/api/ai_tile.hpp
@@ -291,7 +291,7 @@ public:
* for example: SLOPE_N | SLOPE_W (= SLOPE_NW)
* @param tile The tile to raise.
* @param slope Corners to raise (SLOPE_xxx).
- * @pre AIMap::IsValidTile(tile).
+ * @pre tile < AIMap::GetMapSize().
* @exception AIError::ERR_AREA_NOT_CLEAR
* @exception AIError::ERR_TOO_CLOSE_TO_EDGE
* @exception AITile::ERR_TILE_TOO_HIGH
@@ -304,7 +304,7 @@ public:
* for example: SLOPE_N | SLOPE_W (= SLOPE_NW)
* @param tile The tile to lower.
* @param slope Corners to lower (SLOPE_xxx).
- * @pre AIMap::IsValidTile(tile).
+ * @pre tile < AIMap::GetMapSize().
* @exception AIError::ERR_AREA_NOT_CLEAR
* @exception AIError::ERR_TOO_CLOSE_TO_EDGE
* @exception AITile::ERR_TILE_TOO_LOW