summaryrefslogtreecommitdiff
path: root/ai_pathfinder.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-13 18:04:01 +0000
committertron <tron@openttd.org>2005-07-13 18:04:01 +0000
commit8c1d74162f1544e351ae6308cbcca06f324c2c36 (patch)
treeb36523450a7bccf37ca126b6f857d1529d44c67b /ai_pathfinder.c
parent1a1dde7c8d0cf18e49b5af7fef1368216120eed1 (diff)
downloadopenttd-8c1d74162f1544e351ae6308cbcca06f324c2c36.tar.xz
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
Diffstat (limited to 'ai_pathfinder.c')
-rw-r--r--ai_pathfinder.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ai_pathfinder.c b/ai_pathfinder.c
index f26cead73..b4bcbb5e5 100644
--- a/ai_pathfinder.c
+++ b/ai_pathfinder.c
@@ -38,9 +38,9 @@ static bool IsRoad(TileIndex tile)
(IsTileType(tile, MP_STREET) && !IsTileDepotType(tile, TRANSPORT_ROAD)) ||
(IsTileType(tile, MP_TUNNELBRIDGE) && (
// road tunnel?
- ((_map5[tile] & 0x80) == 0 && (_map5[tile] & 0x4) == 0x4) ||
+ ((_m[tile].m5 & 0x80) == 0 && (_m[tile].m5 & 0x4) == 0x4) ||
// road bridge?
- ((_map5[tile] & 0x80) != 0 && (_map5[tile] & 0x2) == 0x2)
+ ((_m[tile].m5 & 0x80) != 0 && (_m[tile].m5 & 0x2) == 0x2)
));
}
@@ -220,11 +220,11 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
if (!PathFinderInfo->rail_or_road && IsRoad(atile)) {
if (IsTileType(atile, MP_TUNNELBRIDGE)) {
// An existing bridge... let's test the direction ;)
- if ((_map5[atile] & 1U) != (i & 1)) continue;
+ if ((_m[atile].m5 & 1U) != (i & 1)) continue;
// This problem only is valid for tunnels:
// When the last tile was not yet a tunnel, check if we enter from the right side..
- if ((_map5[atile] & 0x80) == 0) {
- if (i != (_map5[atile] & 3U)) continue;
+ if ((_m[atile].m5 & 0x80) == 0) {
+ if (i != (_m[atile].m5 & 3U)) continue;
}
}
}
@@ -232,7 +232,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
if (!PathFinderInfo->rail_or_road && IsRoad(ctile)) {
if (IsTileType(ctile, MP_TUNNELBRIDGE)) {
// An existing bridge/tunnel... let's test the direction ;)
- if ((_map5[ctile] & 1U) != (i & 1)) continue;
+ if ((_m[ctile].m5 & 1U) != (i & 1)) continue;
}
}
@@ -278,9 +278,9 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
dir = 0;
} else {
// It already has road.. check if we miss any bits!
- if ((_map5[ctile] & dir) != dir) {
+ if ((_m[ctile].m5 & dir) != dir) {
// We do miss some pieces :(
- dir &= ~_map5[ctile];
+ dir &= ~_m[ctile].m5;
} else {
dir = 0;
}