mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 07:19:41 +00:00
Drop path points while tolerance allows
This commit is contained in:
parent
b9f21ec81a
commit
ea80a81538
1 changed files with 3 additions and 2 deletions
|
@ -262,9 +262,10 @@ namespace MWMechanics
|
||||||
if (mPath.empty())
|
if (mPath.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto tolerance = mPath.size() > 1 ? pointTolerance : destinationTolerance;
|
while (mPath.size() > 1 && sqrDistanceIgnoreZ(mPath.front(), position) < pointTolerance * pointTolerance)
|
||||||
|
mPath.pop_front();
|
||||||
|
|
||||||
if (sqrDistanceIgnoreZ(mPath.front(), position) < tolerance * tolerance)
|
if (mPath.size() == 1 && sqrDistanceIgnoreZ(mPath.front(), position) < destinationTolerance * destinationTolerance)
|
||||||
mPath.pop_front();
|
mPath.pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue