Make summoned creatures go back to summoner on evade if summoner is alive. This should take care of most (all?) errors about controlled creatures trying to target home.

--HG--
branch : trunk
This commit is contained in:
gvcoman
2008-11-22 16:55:17 -05:00
parent bd5ee9e49e
commit 915bc1acda
3 changed files with 20 additions and 5 deletions
@@ -1038,7 +1038,15 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
m_creature->CombatStop();
m_creature->LoadCreaturesAddon();
if( m_creature->isAlive() )
m_creature->GetMotionMaster()->MoveTargetedHome();
{
if (Unit* owner = m_creature->GetOwner())
{
if (owner->isAlive())
m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
}
else
m_creature->GetMotionMaster()->MoveTargetedHome();
}
m_creature->SetLootRecipient(NULL);