diff options
Diffstat (limited to 'ai/trolly/pathfinder.c')
-rw-r--r-- | ai/trolly/pathfinder.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ai/trolly/pathfinder.c b/ai/trolly/pathfinder.c index 772ddda46..de3ce2a4e 100644 --- a/ai/trolly/pathfinder.c +++ b/ai/trolly/pathfinder.c @@ -425,12 +425,13 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, res += AI_PATHFINDER_FOUNDATION_PENALTY; } } else { - if (!(IsRoad(parent->path.node.tile) && IsTileType(parent->path.node.tile, MP_TUNNELBRIDGE))) { + if (!IsRoad(parent->path.node.tile) || !IsTileType(parent->path.node.tile, MP_TUNNELBRIDGE)) { r = GetRoadFoundation(parent_tileh, AiNew_GetRoadDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile)); - if (r >= 15 || r == 0) + if (r >= 15 || r == 0) { res += AI_PATHFINDER_TILE_GOES_UP_PENALTY; - else + } else { res += AI_PATHFINDER_FOUNDATION_PENALTY; + } } } } |