(svn r2447) * Add: [NPF] Penalty for road vehicles making turns.

This commit is contained in:
matthijs
2005-06-16 17:53:40 +00:00
parent 085cc7ca0e
commit fc5784a310
3 changed files with 7 additions and 2 deletions

6
npf.c
View File

@@ -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);