navparser.cpp: fix bugs in findClosestNavSquare

It never used overlapping areas
This commit is contained in:
Unnamed 2019-09-05 07:48:24 +00:00 committed by TotallyNotElite
parent fbe949a5cd
commit 9f30c9916d

View File

@ -455,11 +455,11 @@ CNavArea *findClosestNavSquare(const Vector &vec)
ovBestDist = dist;
ovBestSquare = &i;
}
if (bestSquare)
if (!ovBestSquare)
ovBestSquare = bestSquare;
if (isLocal)
findClosestNavSquare_localAreas.push_back(bestSquare);
findClosestNavSquare_localAreas.push_back(ovBestSquare);
return ovBestSquare;
}