Core/Creature: add an assertion to guard against infinite loops

Port From (https://github.com/TrinityCore/TrinityCore/commit/cb3a041482626a8aa3545a6bc35abd9dfb88cf73)
This commit is contained in:
hondacrx
2021-06-23 15:12:20 -04:00
parent 44cfe32b50
commit 3f5ac71ff0
@@ -939,6 +939,7 @@ namespace Game.Entities
if (!mgr.IsThreatenedBy(newTarget, 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;
}
else