summaryrefslogtreecommitdiff
path: root/src/pathfinder/npf
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-02 00:01:07 +0000
committerrubidium <rubidium@openttd.org>2009-12-02 00:01:07 +0000
commit9d5ff5def0790ead791b7ef09727d3ad3b41e565 (patch)
tree9320a45ecc7c0657d387d786fc55b18e9a705174 /src/pathfinder/npf
parent76fe20cdccd68679f4681e3f378b7695d161e8a8 (diff)
downloadopenttd-9d5ff5def0790ead791b7ef09727d3ad3b41e565.tar.xz
(svn r18368) -Fix: alignment of comment and 'add' some missing comments
Diffstat (limited to 'src/pathfinder/npf')
-rw-r--r--src/pathfinder/npf/npf.cpp6
-rw-r--r--src/pathfinder/npf/npf_func.h8
2 files changed, 11 insertions, 3 deletions
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index 50795d0ed..085a00053 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -1133,9 +1133,9 @@ Track NPFShipChooseTrack(Ship *v, TileIndex tile, DiagDirection enterdir, TrackB
NPFFoundTargetData ftd = NPFRouteToStationOrTile(tile - TileOffsByDiagDir(enterdir), trackdir, true, &fstd, TRANSPORT_WATER, 0, v->owner, INVALID_RAILTYPES);
/* If ftd.best_bird_dist is 0, we found our target and ftd.best_trackdir contains
- * the direction we need to take to get there, if ftd.best_bird_dist is not 0,
- * we did not find our target, but ftd.best_trackdir contains the direction leading
- * to the tile closest to our target. */
+ * the direction we need to take to get there, if ftd.best_bird_dist is not 0,
+ * we did not find our target, but ftd.best_trackdir contains the direction leading
+ * to the tile closest to our target. */
if (ftd.best_trackdir == 0xff) return INVALID_TRACK;
return TrackdirToTrack(ftd.best_trackdir);
}
diff --git a/src/pathfinder/npf/npf_func.h b/src/pathfinder/npf/npf_func.h
index 7121ba065..4d38d5807 100644
--- a/src/pathfinder/npf/npf_func.h
+++ b/src/pathfinder/npf/npf_func.h
@@ -12,6 +12,14 @@
#ifndef NPF_FUNC_H
#define NPF_FUNC_H
+/**
+ * Finds the best path for given ship using NPF.
+ * @param v the ship that needs to find a path
+ * @param tile the tile to find the path from (should be next tile the ship is about to enter)
+ * @param enterdir diagonal direction which the ship will enter this new tile from
+ * @param tracks available tracks on the new tile (to choose from)
+ * @return the best trackdir for next turn or INVALID_TRACK if the path could not be found
+ */
Track NPFShipChooseTrack(class Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks);
#endif /* NPF_FUNC_H */