mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 12:36:42 +00:00
Simplify PathFinder::checkPathCompleted
This commit is contained in:
parent
6411c1955d
commit
2c6daa74a9
1 changed files with 2 additions and 11 deletions
|
@ -265,19 +265,10 @@ namespace MWMechanics
|
||||||
|
|
||||||
bool PathFinder::checkPathCompleted(float x, float y, float tolerance)
|
bool PathFinder::checkPathCompleted(float x, float y, float tolerance)
|
||||||
{
|
{
|
||||||
if(mPath.empty())
|
if (!mPath.empty() && sqrDistanceIgnoreZ(mPath.front(), x, y) < tolerance*tolerance)
|
||||||
return true;
|
|
||||||
|
|
||||||
if (sqrDistanceIgnoreZ(mPath.front(), x, y) < tolerance*tolerance)
|
|
||||||
{
|
|
||||||
mPath.pop_front();
|
mPath.pop_front();
|
||||||
if(mPath.empty())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return mPath.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
// see header for the rationale
|
// see header for the rationale
|
||||||
|
|
Loading…
Reference in a new issue