Fix another case of droids driving in circles when pushed off their designated paths

and they end up equally close (after applying weights) to both current and next path
nodes.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8049 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2009-08-24 16:21:29 +00:00 committed by Git SVN Gateway
parent ab7d5aa9af
commit 46022ae734
1 changed files with 4 additions and 2 deletions

View File

@ -1667,8 +1667,10 @@ static Vector2f moveGetDirection(DROID *psDroid)
{
dest = Vector2f_Normalise(nextDelta);
}
// We are passing the next waypoint, so for now don't interpolate it
else if (nextMagnitude < FLT_EPSILON)
// We are passing the next waypoint or so close we could be circling between both,
// so for now don't interpolate it. Instead head to the first unvisited waypoint as
// a silly workaround. What we should do is drop this waypoint and head to the next.
else if (nextMagnitude < WAYPOINT_DSQ)
{
dest = Vector2f_Normalise(delta);
}