1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-17 19:20:49 +00:00

Simplify PathFinder::checkPathCompleted

This commit is contained in:
elsid 2018-08-18 13:51:31 +03:00
parent 6411c1955d
commit 2c6daa74a9
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

View File

@ -265,19 +265,10 @@ namespace MWMechanics
bool PathFinder::checkPathCompleted(float x, float y, float tolerance)
{
if(mPath.empty())
return true;
if (sqrDistanceIgnoreZ(mPath.front(), x, y) < tolerance*tolerance)
{
if (!mPath.empty() && sqrDistanceIgnoreZ(mPath.front(), x, y) < tolerance*tolerance)
mPath.pop_front();
if(mPath.empty())
{
return true;
}
}
return false;
return mPath.empty();
}
// see header for the rationale