Silence uninitialized variable warnings on MakeGoalReachable and FindNearestNavcellInRegions in 208fc30ddd

These variables might be used uninitialised in very odd cases that don't
happen in svn.

Reported By: elexis
Differential Revision: https://code.wildfiregames.com/D2250
This was SVN commit r22877.
This commit is contained in:
wraitii
2019-09-09 18:56:49 +00:00
parent d7e08a848a
commit 9cc8a579f5
@@ -716,7 +716,7 @@ void HierarchicalPathfinder::FindNearestPassableNavcell(u16& i, u16& j, pass_cla
void HierarchicalPathfinder::FindNearestNavcellInRegions(const std::set<RegionID, SortByCenterToPoint>& regions, u16& iGoal, u16& jGoal, pass_class_t passClass) const
{
u16 bestI, bestJ;
u16 bestI = iGoal, bestJ = jGoal; // Somewhat sensible default-values should regions() be passed empty.
u32 bestDist = std::numeric_limits<u32>::max();
// Because regions are sorted by increasing distance, we can ignore regions that are obviously farther than the current best point.