*Thread safe player searcher in scripts.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-30 15:51:07 +02:00
parent 9bda35c7df
commit d666ba26c1
32 changed files with 69 additions and 66 deletions
@@ -286,7 +286,7 @@ struct boss_kelthuzadAI : public BossAI
std::map<uint64, float>::const_iterator itr;
for (itr = chained.begin(); itr != chained.end(); ++itr)
{
if (Player* charmed = Unit::GetPlayer((*itr).first))
if (Player* charmed = Unit::GetPlayer(*me, (*itr).first))
charmed->SetFloatValue(OBJECT_FIELD_SCALE_X, (*itr).second);
}
@@ -331,7 +331,7 @@ struct boss_kelthuzadAI : public BossAI
std::map<uint64, float>::const_iterator itr;
for (itr = chained.begin(); itr != chained.end(); ++itr)
{
if (Player* pPlayer = Unit::GetPlayer((*itr).first))
if (Player* pPlayer = Unit::GetPlayer(*me, (*itr).first))
pPlayer->SetFloatValue(OBJECT_FIELD_SCALE_X, (*itr).second);
}
chained.clear();
@@ -511,7 +511,7 @@ struct boss_kelthuzadAI : public BossAI
std::map<uint64, float>::iterator itr;
for (itr = chained.begin(); itr != chained.end();)
{
if (Unit* player = Unit::GetPlayer((*itr).first))
if (Unit* player = Unit::GetPlayer(*me, (*itr).first))
{
if (!player->isCharmed())
{
@@ -203,7 +203,7 @@ struct boss_sapphironAI : public BossAI
{
for (IceBlockMap::const_iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr)
{
if (Player* pPlayer = Unit::GetPlayer(itr->first))
if (Player* pPlayer = Unit::GetPlayer(*me, itr->first))
pPlayer->RemoveAura(SPELL_ICEBOLT);
if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second))
pGo->Delete();