mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 15:11:36 -04: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