fix(Core/SmartAI): add prevent almost infinite spinning of mutual target to pets (#19090)
fix(Core/SmartAI)petspin
This commit is contained in:
@@ -108,6 +108,14 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||||||
mutualChase = true;
|
mutualChase = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent almost infinite spinning for pets with mutualTarget
|
||||||
|
// _mutualChase is false for previous check
|
||||||
|
if (angle && !mutualChase && !_mutualChase && mutualTarget && chaseRange < meleeRange && cOwner && cOwner->IsPet())
|
||||||
|
{
|
||||||
|
angle = Optional<ChaseAngle>();
|
||||||
|
mutualChase = true;
|
||||||
|
}
|
||||||
|
|
||||||
// periodically check if we're already in the expected range...
|
// periodically check if we're already in the expected range...
|
||||||
i_recheckDistance.Update(time_diff);
|
i_recheckDistance.Update(time_diff);
|
||||||
if (i_recheckDistance.Passed())
|
if (i_recheckDistance.Passed())
|
||||||
|
|||||||
Reference in New Issue
Block a user