diff options
author | matthijs <matthijs@openttd.org> | 2005-06-16 17:53:40 +0000 |
---|---|---|
committer | matthijs <matthijs@openttd.org> | 2005-06-16 17:53:40 +0000 |
commit | fc5784a3103d5e4fc0dbfec5f905a6ebbfd9c84b (patch) | |
tree | b393c22d92fe82d6de7c2c0eef53d90bfd8e3430 /npf.c | |
parent | 085cc7ca0ef7e9ac88d197669177fc8d7d8266f8 (diff) | |
download | openttd-fc5784a3103d5e4fc0dbfec5f905a6ebbfd9c84b.tar.xz |
(svn r2447) * Add: [NPF] Penalty for road vehicles making turns.
Diffstat (limited to 'npf.c')
-rw-r--r-- | npf.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |