summaryrefslogtreecommitdiff
path: root/src/pathfinder/npf
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-04-01 09:03:12 +0100
committerGitHub <noreply@github.com>2021-04-01 10:03:12 +0200
commit591ea9862d89787c1013c341be919dcb3a83ba06 (patch)
tree5f137c0e5d671e80461dc0c4920b38af77c99933 /src/pathfinder/npf
parent088964a09100651798c6eb8cfffcaf79f9b5987f (diff)
downloadopenttd-591ea9862d89787c1013c341be919dcb3a83ba06.tar.xz
Codechange: Suppress warnings when asserts are disabled (#8916)
Diffstat (limited to 'src/pathfinder/npf')
-rw-r--r--src/pathfinder/npf/npf.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index 5a5ff927e..315b43b0e 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -1000,9 +1000,6 @@ static void NPFFollowTrack(AyStar *aystar, OpenListNode *current)
*/
static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start_tile1, AyStarNode *start2, bool ignore_start_tile2, NPFFindStationOrTileData *target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, AyStarUserData *user, uint reverse_penalty, bool ignore_reserved = false, int max_penalty = 0)
{
- int r;
- NPFFoundTargetData result;
-
/* Initialize procs */
_npf_aystar.max_path_cost = max_penalty;
_npf_aystar.CalculateH = heuristic_proc;
@@ -1032,6 +1029,7 @@ static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start
}
/* Initialize result */
+ NPFFoundTargetData result;
result.best_bird_dist = UINT_MAX;
result.best_path_dist = UINT_MAX;
result.best_trackdir = INVALID_TRACKDIR;
@@ -1046,7 +1044,8 @@ static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start
_npf_aystar.user_data = user;
/* GO! */
- r = _npf_aystar.Main();
+ int r = _npf_aystar.Main();
+ (void)r; // assert only
assert(r != AYSTAR_STILL_BUSY);
if (result.best_bird_dist != 0) {