From bc2cec86e9ca16abdab140aff40a1739e35c066a Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Thu, 24 Dec 2020 04:18:39 +0100 Subject: [PATCH] Fix bug: NPCs doesn't move if the target is exactly above or exactly below. --- apps/openmw/mwmechanics/pathfinding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/pathfinding.cpp b/apps/openmw/mwmechanics/pathfinding.cpp index 276321b81..595f9d629 100644 --- a/apps/openmw/mwmechanics/pathfinding.cpp +++ b/apps/openmw/mwmechanics/pathfinding.cpp @@ -309,7 +309,7 @@ namespace MWMechanics if (mPath.size() > 1 && isAlmostStraight(position, mPath[0], mPath[1], pointTolerance)) mPath.pop_front(); - if (mPath.size() == 1 && sqrDistanceIgnoreZ(mPath.front(), position) < destinationTolerance * destinationTolerance) + if (mPath.size() == 1 && (mPath.front() - position).length2() < destinationTolerance * destinationTolerance) mPath.pop_front(); }