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:
parent
6411c1955d
commit
2c6daa74a9
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user