diff options
author | truelight <truelight@openttd.org> | 2007-07-23 15:14:45 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-07-23 15:14:45 +0000 |
commit | c4e47c07c9b18023e7bb57670a33924b21ef2ff8 (patch) | |
tree | 56693060f496bb0a45ba62b0af7a3696d7de2130 /src | |
parent | 6196ff12632709156eca342a15da7f530796b318 (diff) | |
download | openttd-c4e47c07c9b18023e7bb57670a33924b21ef2ff8.tar.xz |
(svn r10655) -Fix [FS#1070]: Trolly AI didn't know about steep slopes, and used wrong tileh in some cases (frosch)
Diffstat (limited to 'src')
-rw-r--r-- | src/ai/trolly/pathfinder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp index 4cc160748..e4f964dad 100644 --- a/src/ai/trolly/pathfinder.cpp +++ b/src/ai/trolly/pathfinder.cpp @@ -411,7 +411,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, if (PathFinderInfo->rail_or_road) { r = GetRailFoundation(parent_tileh, (TrackBits)(1 << AiNew_GetRailDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile))); // Maybe is BRIDGE_NO_FOUNDATION a bit strange here, but it contains just the right information.. - if (r >= 15 || (r == 0 && HASBIT(BRIDGE_NO_FOUNDATION, tileh))) { + if (IS_INT_INSIDE(r,15,15+8) || (r == 0 && HASBIT(BRIDGE_NO_FOUNDATION, parent_tileh))) { res += AI_PATHFINDER_TILE_GOES_UP_PENALTY; } else { res += AI_PATHFINDER_FOUNDATION_PENALTY; @@ -419,7 +419,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, } else { if (!IsRoad(parent->path.node.tile) || !IsTileType(parent->path.node.tile, MP_TUNNELBRIDGE)) { r = GetRoadFoundation(parent_tileh, (RoadBits)AiNew_GetRoadDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile)); - if (r >= 15 || r == 0) { + if (IS_INT_INSIDE(r,15,15+8) || (r == 0 && HASBIT(BRIDGE_NO_FOUNDATION, parent_tileh))) { res += AI_PATHFINDER_TILE_GOES_UP_PENALTY; } else { res += AI_PATHFINDER_FOUNDATION_PENALTY; |