*Fix a crash bug of phase hunter script.
--HG-- branch : trunk
This commit is contained in:
@@ -814,7 +814,8 @@ struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI
|
|||||||
|
|
||||||
void Aggro(Unit *who)
|
void Aggro(Unit *who)
|
||||||
{
|
{
|
||||||
PlayerGUID = who->GetGUID();
|
if(Player *player = who->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||||
|
PlayerGUID = player->GetGUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellHit(Unit *caster, const SpellEntry *spell)
|
void SpellHit(Unit *caster, const SpellEntry *spell)
|
||||||
@@ -849,7 +850,8 @@ struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
Unit* target = Unit::GetUnit((*m_creature), PlayerGUID);
|
Unit* target = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||||
|
|
||||||
if(target && !Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent) && ((Player*)target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE)
|
if(target && !Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent)
|
||||||
|
&& ((Player*)target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE)
|
||||||
{
|
{
|
||||||
DoTextEmote(EMOTE_WEAK, 0);
|
DoTextEmote(EMOTE_WEAK, 0);
|
||||||
Weak = true;
|
Weak = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user