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

(cherry picked from commit 320306554c2240c74d991f459e7bad5eef39ec5a)
This commit is contained in:
Treeston
2021-06-18 21:20:41 +02:00
committed by Shauren
parent 3758fa5862
commit cb3a041482
@@ -1228,6 +1228,7 @@ Unit* Creature::SelectVictim()
if (!mgr.IsThreatenedBy(newTarget, true))
{
mgr.AddThreat(newTarget, 0.0f, nullptr, true, true);
ASSERT(mgr.IsThreatenedBy(newTarget, true), "%s tried to add combatant %s to threat list, but this failed - potential infinite loop", GetName().c_str(), newTarget->GetName().c_str()); // prevent potential infinite loop
break;
}
else