From b05d2675fcb9d95ddf91b96c45985d03ce3cbd71 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 13 Dec 2010 21:55:59 +0000 Subject: (svn r21509) -Codechange: rename the rail pathfinders "path_not_found" parameter to "path_found" and remove the ! where the variables are set / read --- src/pathfinder/npf/npf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pathfinder/npf/npf.cpp') diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp index d6ad43e4d..45d968529 100644 --- a/src/pathfinder/npf/npf.cpp +++ b/src/pathfinder/npf/npf.cpp @@ -1240,7 +1240,7 @@ bool NPFTrainCheckReverse(const Train *v) return ftd.best_bird_dist != 0 && NPFGetFlag(&ftd.node, NPF_FLAG_REVERSE); } -Track NPFTrainChooseTrack(const Train *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool *path_not_found, bool reserve_track, struct PBSTileInfo *target) +Track NPFTrainChooseTrack(const Train *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, bool reserve_track, struct PBSTileInfo *target) { NPFFindStationOrTileData fstd; NPFFillWithOrderData(&fstd, v, reserve_track); @@ -1260,7 +1260,7 @@ Track NPFTrainChooseTrack(const Train *v, TileIndex tile, DiagDirection enterdir /* We are already at our target. Just do something * @todo maybe display error? * @todo: go straight ahead if possible? */ - if (path_not_found) *path_not_found = false; + path_found = true; return FindFirstTrack(tracks); } @@ -1268,7 +1268,7 @@ Track NPFTrainChooseTrack(const Train *v, TileIndex tile, DiagDirection enterdir * 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 (path_not_found != NULL) *path_not_found = (ftd.best_bird_dist != 0); + path_found = (ftd.best_bird_dist == 0); /* Discard enterdir information, making it a normal track */ return TrackdirToTrack(ftd.best_trackdir); } -- cgit v1.2.3-54-g00ecf