mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-13 21:49:49 +01:00
*Fix some script crash casued by threatlist.
--HG-- branch : trunk
This commit is contained in:
@@ -247,10 +247,11 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
|
||||
|
||||
std::list<HostilReference*>::iterator i;
|
||||
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end();)
|
||||
{
|
||||
Unit* pUnit = NULL;
|
||||
pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
|
||||
++i;
|
||||
|
||||
if (pUnit)
|
||||
{
|
||||
|
||||
@@ -94,9 +94,10 @@ struct TRINITY_DLL_DECL boss_patchwerkAI : public ScriptedAI
|
||||
Unit* pTemp = NULL;
|
||||
std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
|
||||
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i!=m_creature->getThreatManager().getThreatList().end(); ++i)
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i!=m_creature->getThreatManager().getThreatList().end();)
|
||||
{
|
||||
pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
|
||||
++i;
|
||||
if (pTemp && pTemp->isAlive() && pTemp->GetHealth() > MostHP && m_creature->GetDistance2d(pTemp) < 5)
|
||||
{
|
||||
MostHP = pTemp->GetHealth();
|
||||
|
||||
@@ -913,9 +913,10 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
DoTeleportTo(GRAVITY_X, GRAVITY_Y, GRAVITY_Z);
|
||||
// 1) Kael'thas will portal the whole raid right into his body
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
|
||||
++i;
|
||||
if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
|
||||
{
|
||||
//Use work around packet to prevent player from being dropped from combat
|
||||
@@ -937,9 +938,10 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
||||
}
|
||||
|
||||
// 2) At that point he will put a Gravity Lapse debuff on everyone
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();i++)
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
|
||||
++i;
|
||||
if(pUnit && pUnit->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true);
|
||||
@@ -971,9 +973,10 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
||||
|
||||
case 3:
|
||||
//Remove flight
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();i++)
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
|
||||
++i;
|
||||
if(pUnit && pUnit->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
//Using packet workaround
|
||||
|
||||
Reference in New Issue
Block a user