Use GUIDs instead of "global" pointers in zone scripts.
This commit is like that: 7714 / rce505237e4aa And use const_iterators where it is possible. --HG-- branch : trunk
This commit is contained in:
@@ -152,7 +152,7 @@ struct boss_ionarAI : public ScriptedAI
|
||||
if (m_lSparkGUIDList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<uint64>::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr)
|
||||
for (std::list<uint64>::const_iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = m_creature->GetMap()->GetCreature(*itr))
|
||||
{
|
||||
@@ -173,7 +173,7 @@ struct boss_ionarAI : public ScriptedAI
|
||||
Position pos;
|
||||
m_creature->GetPosition(&pos);
|
||||
|
||||
for (std::list<uint64>::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr)
|
||||
for (std::list<uint64>::const_iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pSpark = Unit::GetCreature(*m_creature, *itr))
|
||||
{
|
||||
|
||||
@@ -169,7 +169,7 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
if (m_lGolemGUIDList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<uint64>::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
|
||||
for (std::list<uint64>::const_iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
|
||||
{
|
||||
@@ -186,7 +186,7 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
if (m_lGolemGUIDList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<uint64>::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
|
||||
for (std::list<uint64>::const_iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
|
||||
{
|
||||
|
||||
@@ -162,7 +162,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
|
||||
if (!lKaddrakGUIDList.empty())
|
||||
{
|
||||
uint32 uiPositionCounter = 0;
|
||||
for (std::list<Creature*>::iterator itr = lKaddrakGUIDList.begin(); itr != lKaddrakGUIDList.end(); ++itr)
|
||||
for (std::list<Creature*>::const_iterator itr = lKaddrakGUIDList.begin(); itr != lKaddrakGUIDList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->isAlive())
|
||||
{
|
||||
@@ -277,7 +277,7 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
{
|
||||
if (lDwarfGUIDList.empty())
|
||||
return;
|
||||
for (std::list<uint64>::iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
|
||||
for (std::list<uint64>::const_iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
|
||||
{
|
||||
Creature* pTemp = Unit::GetCreature(*m_creature, pInstance ? (*itr) : 0);
|
||||
if (pTemp && pTemp->isAlive())
|
||||
|
||||
@@ -166,7 +166,7 @@ struct boss_algalonAI : public ScriptedAI
|
||||
if (m_lCollapsingStarGUIDList.empty())
|
||||
return;
|
||||
|
||||
for(std::list<uint64>::iterator itr = m_lCollapsingStarGUIDList.begin(); itr != m_lCollapsingStarGUIDList.end(); ++itr)
|
||||
for(std::list<uint64>::const_iterator itr = m_lCollapsingStarGUIDList.begin(); itr != m_lCollapsingStarGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
|
||||
{
|
||||
|
||||
@@ -187,7 +187,7 @@ struct boss_razorscaleAI : public BossAI
|
||||
std::list<Unit*> pTargets;
|
||||
SelectTargetList(pTargets, RAID_MODE(3,9), SELECT_TARGET_RANDOM, 100, true);
|
||||
uint8 i = 0;
|
||||
for (std::list<Unit*>::iterator itr = pTargets.begin(); itr != pTargets.end();)
|
||||
for (std::list<Unit*>::const_iterator itr = pTargets.begin(); itr != pTargets.end();)
|
||||
{
|
||||
if (m_creature->HasInArc(M_PI, *itr))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user