Skip to content

Commit

Permalink
Fix circling at the start of paths by removing the facePoint check fo…
Browse files Browse the repository at this point in the history
…r waypoint skipping.
  • Loading branch information
GoogleFrog authored and ashdnazg committed Jun 10, 2019
1 parent a71e8d9 commit 5b914dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rts/Sim/MoveTypes/GroundMoveType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1589,11 +1589,10 @@ bool CGroundMoveType::CanSetNextWayPoint() {
// note: can somehow cause units to move in circles near obstacles
// (mantis3718) if rectangle is too generous in size
const bool rangeTest = owner->moveDef->TestMoveSquareRange(owner, float3::min(cwp, pos), float3::max(cwp, pos), owner->speed, true, true, true);
const bool facePoint = ((cwp - pos).dot(flatFrontDir) >= 0.0f);
const bool allowSkip = ((cwp - pos).SqLength() <= Square(SQUARE_SIZE));

// CanSetNextWayPoint may return true if (allowSkip || (rangeTest && facePoint))
if (!allowSkip && (!rangeTest || !facePoint))
// CanSetNextWayPoint may return true if (allowSkip || rangeTest)
if (!allowSkip && !rangeTest)
return false;
}

Expand Down

0 comments on commit 5b914dd

Please sign in to comment.