mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core/Creature: add an assertion to guard against infinite loops
(cherry picked from commit 320306554c)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user