*Thread safe player searcher in scripts.
--HG-- branch : trunk
This commit is contained in:
@@ -138,7 +138,7 @@ struct npc_unworthy_initiateAI : public ScriptedAI
|
||||
wait_timer = 5000;
|
||||
me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true);
|
||||
|
||||
if (Player* starter = Unit::GetPlayer(playerGUID))
|
||||
if (Player* starter = Unit::GetPlayer(*me, playerGUID))
|
||||
DoScriptText(say_event_attack[rand()%9], me, starter);
|
||||
|
||||
phase = PHASE_TO_ATTACK;
|
||||
@@ -246,7 +246,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff)
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
phase = PHASE_ATTACKING;
|
||||
|
||||
if (Player *pTarget = Unit::GetPlayer(playerGUID))
|
||||
if (Player *pTarget = Unit::GetPlayer(*me, playerGUID))
|
||||
me->AI()->AttackStart(pTarget);
|
||||
wait_timer = 0;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ struct npc_crusade_persuadedAI : public ScriptedAI
|
||||
{
|
||||
if (uiSpeech_timer <= diff)
|
||||
{
|
||||
Player* pPlayer = Unit::GetPlayer(uiPlayerGUID);
|
||||
Player* pPlayer = Unit::GetPlayer(*me, uiPlayerGUID);
|
||||
if (!pPlayer)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
@@ -634,7 +634,7 @@ struct npc_a_special_surpriseAI : public ScriptedAI
|
||||
{
|
||||
if (ExecuteSpeech_Timer <= diff)
|
||||
{
|
||||
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
|
||||
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
|
||||
|
||||
if (!pPlayer)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user