summaryrefslogtreecommitdiff
path: root/src/ai/trolly/pathfinder.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-24 21:45:54 +0000
committerrubidium <rubidium@openttd.org>2007-05-24 21:45:54 +0000
commit3d143446ee743afe7f434be7f285f793c2165f16 (patch)
treea60c49017c933cc546dc7f046008c43285a8bfad /src/ai/trolly/pathfinder.cpp
parentc5a3dcb3f0ff761d444bdf7c381fcbd55782ae9b (diff)
downloadopenttd-3d143446ee743afe7f434be7f285f793c2165f16.tar.xz
(svn r9912) -Fix: the AIs could build any road(station)s.
Diffstat (limited to 'src/ai/trolly/pathfinder.cpp')
-rw-r--r--src/ai/trolly/pathfinder.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp
index 0091939b1..e7102d642 100644
--- a/src/ai/trolly/pathfinder.cpp
+++ b/src/ai/trolly/pathfinder.cpp
@@ -237,17 +237,10 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
if (IsTunnel(atile)) {
if (GetTunnelDirection(atile) != i) continue;
} else {
- if ((_m[atile].m5 & 1) != DiagDirToAxis(i)) continue;
+ if (GetBridgeRampDirection(atile) != i) continue;
}
}
}
- // But also if we are on a bridge, we can only move a certain direction
- if (!PathFinderInfo->rail_or_road && IsRoad(ctile)) {
- if (IsTileType(ctile, MP_TUNNELBRIDGE)) {
- // An existing bridge/tunnel... let's test the direction ;)
- if ((_m[ctile].m5 & 1) != (i & 1)) continue;
- }
- }
if ((AI_PATHFINDER_FLAG_BRIDGE & current->path.node.user_data[0]) != 0 ||
(AI_PATHFINDER_FLAG_TUNNEL & current->path.node.user_data[0]) != 0) {
@@ -291,9 +284,9 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
dir = 0;
} else {
// It already has road.. check if we miss any bits!
- if ((_m[ctile].m5 & dir) != dir) {
+ if ((GetRoadBits(ctile, ROADTYPE_ROAD) & dir) != dir) {
// We do miss some pieces :(
- dir &= ~_m[ctile].m5;
+ dir &= ~GetRoadBits(ctile, ROADTYPE_ROAD);
} else {
dir = 0;
}