Core/Creature: add an assertion to guard against infinite loops
Port From (https://github.com/TrinityCore/TrinityCore/commit/cb3a041482626a8aa3545a6bc35abd9dfb88cf73)
This commit is contained in:
@@ -939,6 +939,7 @@ namespace Game.Entities
|
|||||||
if (!mgr.IsThreatenedBy(newTarget, true))
|
if (!mgr.IsThreatenedBy(newTarget, true))
|
||||||
{
|
{
|
||||||
mgr.AddThreat(newTarget, 0.0f, null, true, true);
|
mgr.AddThreat(newTarget, 0.0f, null, true, true);
|
||||||
|
Cypher.Assert(mgr.IsThreatenedBy(newTarget, true), $"{GetName()} tried to add combatant {newTarget.GetName()} to threat list, but this failed - potential infinite loop"); // prevent potential infinite loop
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user