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

This commit is contained in:
Treeston
2018-01-28 01:51:13 +01:00
parent 4130647bf6
commit 320306554c

View File

@@ -1127,6 +1127,7 @@ Unit* Creature::SelectVictim()
if (!mgr.IsThreatenedBy(newTarget, true))
{
mgr.AddThreat(newTarget, 0.0f, nullptr, true, true);
ASSERT(mgr.IsThreatenedBy(newTarget), "%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