From 8c1d74162f1544e351ae6308cbcca06f324c2c36 Mon Sep 17 00:00:00 2001 From: tron Date: Wed, 13 Jul 2005 18:04:01 +0000 Subject: (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. --- ai_pathfinder.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'ai_pathfinder.c') 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; } -- cgit v1.2.3-54-g00ecf