summaryrefslogtreecommitdiff
path: root/src/pathfinder
diff options
context:
space:
mode:
Diffstat (limited to 'src/pathfinder')
-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) {