summaryrefslogtreecommitdiff
path: root/ai_pathfinder.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-03 12:56:22 +0000
committertron <tron@openttd.org>2005-01-03 12:56:22 +0000
commit32bfe0dddde81d016cb8de15e6a41bca3506d7be (patch)
tree04b3f2dd580a9cd8387358c91a0cfcf95a525153 /ai_pathfinder.c
parent4c14afba4eae4bbfe3d448eeaa072e11b326c78a (diff)
downloadopenttd-32bfe0dddde81d016cb8de15e6a41bca3506d7be.tar.xz
(svn r1337) Use MapMax[XY]() (or MapSize[XY]() if appropriate) instead of TILE_MAX_[XY]
While here replace one erroneous TILE_MAX_X with MapMaxY()
Diffstat (limited to 'ai_pathfinder.c')
-rw-r--r--ai_pathfinder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ai_pathfinder.c b/ai_pathfinder.c
index abde1e772..2fd8f574b 100644
--- a/ai_pathfinder.c
+++ b/ai_pathfinder.c
@@ -175,8 +175,8 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
// Go through all surrounding tiles and check if they are within the limits
for (i=0;i<4;i++) {
- if (GET_TILE_X(_tiles_around[i] + current->path.node.tile) > 1 && GET_TILE_X(_tiles_around[i] + current->path.node.tile) < TILE_X_MAX - 1 &&
- GET_TILE_Y(_tiles_around[i] + current->path.node.tile) > 1 && GET_TILE_Y(_tiles_around[i] + current->path.node.tile) < TILE_Y_MAX - 1) {
+ if (GET_TILE_X(_tiles_around[i] + current->path.node.tile) > 1 && GET_TILE_X(_tiles_around[i] + current->path.node.tile) < MapMaxX() - 1 &&
+ GET_TILE_Y(_tiles_around[i] + current->path.node.tile) > 1 && GET_TILE_Y(_tiles_around[i] + current->path.node.tile) < MapMaxY() - 1) {
// We also directly test if the current tile can connect to this tile..
// We do this simply by just building the tile!