mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-08 10:09:16 +00:00
UnitMotion: Fix ShouldAlternatePathfinder() using wrong constant
Used MAX_FAILED_MOVEMENTS (a fixed constant) instead of
m_FailedMovements, making the "every N failures" clause always
false at compile time. Alternation only ever fired once per
failure streak instead of periodically as intended.
Introduced in 70ec781.
This commit is contained in:
1 parent
f10fe18d7a
commit
43d8446854
1 file changed
+1
-1
@@ -746,7 +746,7 @@ private:
|
||||
|
||||
bool ShouldAlternatePathfinder() const
|
||||
{
|
||||
return (m_FailedMovements == ALTERNATE_PATH_TYPE_DELAY) || ((MAX_FAILED_MOVEMENTS - ALTERNATE_PATH_TYPE_DELAY) % ALTERNATE_PATH_TYPE_EVERY == 0);
|
||||
return (m_FailedMovements == ALTERNATE_PATH_TYPE_DELAY) || ((m_FailedMovements - ALTERNATE_PATH_TYPE_DELAY) % ALTERNATE_PATH_TYPE_EVERY == 0);
|
||||
}
|
||||
|
||||
bool InShortPathRange(const PathGoal& goal, const CFixedVector2D& pos) const
|
||||
|
||||
Reference in new issue
Block a user