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:
Anubisss
2010-04-02 15:41:37 +02:00
parent 7c4f2f520f
commit 08b4748e62
85 changed files with 289 additions and 256 deletions
+2 -2
View File
@@ -738,7 +738,7 @@ void npc_doctorAI::PatientSaved(Creature* soldier, Player* pPlayer, Location* Po
{
if (!Patients.empty())
{
std::list<uint64>::iterator itr;
std::list<uint64>::const_iterator itr;
for (itr = Patients.begin(); itr != Patients.end(); ++itr)
{
if (Creature* Patient = Unit::GetCreature((*m_creature), *itr))
@@ -1804,7 +1804,7 @@ struct npc_ebon_gargoyleAI : CasterAI
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_creature, m_creature, 30);
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_creature, targets, u_check);
m_creature->VisitNearbyObject(30, searcher);
for (std::list<Unit*>::iterator iter = targets.begin(); iter != targets.end(); ++iter)
for (std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
if((*iter)->GetAura(49206,owner->GetGUID()))
{
me->Attack((*iter),false);