summaryrefslogtreecommitdiff
path: root/npf.c
diff options
context:
space:
mode:
Diffstat (limited to 'npf.c')
-rw-r--r--npf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/npf.c b/npf.c
index c3d0f0bef..f8fb7ed0c 100644
--- a/npf.c
+++ b/npf.c
@@ -322,8 +322,10 @@ int32 NPFRoadPathCost(AyStar* as, AyStarNode* current, OpenListNode* parent) {
/* Check for slope */
cost += NPFSlopeCost(current);
- /* Check for turns */
- //TODO
+ /* Check for turns. Road vehicles only really drive diagonal, turns are
+ * represented by non-diagonal tracks */
+ if (!IsDiagonalTrackdir(current->direction))
+ cost += _patches.npf_road_curve_penalty;
NPFMarkTile(tile);
DEBUG(npf, 4)("Calculating G for: (%d, %d). Result: %d", TileX(current->tile), TileY(current->tile), cost);