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

(cherry picked from commit 320306554c)
This commit is contained in:
Treeston
2018-01-28 01:51:13 +01:00
committed by Shauren
parent 3758fa5862
commit cb3a041482

View File

@@ -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