mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user