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:
@@ -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);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ void AggressorAI::EnterEvadeMode()
|
||||
//i_tracker.Reset(TIME_INTERVAL_LOOK);
|
||||
}
|
||||
|
||||
if(!i_creature.isCharmed())
|
||||
if(!i_creature.GetCharmerOrOwner())
|
||||
{
|
||||
i_creature.RemoveAllAuras();
|
||||
|
||||
@@ -106,6 +106,8 @@ void AggressorAI::EnterEvadeMode()
|
||||
if( i_creature.GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
|
||||
i_creature.GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
else if (i_creature.GetOwner() && i_creature.GetOwner()->isAlive())
|
||||
i_creature.GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
|
||||
|
||||
i_creature.DeleteThreatList();
|
||||
i_victimGuid = 0;
|
||||
|
||||
@@ -123,7 +123,12 @@ ReactorAI::EnterEvadeMode()
|
||||
i_creature.CombatStop();
|
||||
i_creature.SetLootRecipient(NULL);
|
||||
|
||||
// Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
|
||||
if( i_creature.GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
|
||||
i_creature.GetMotionMaster()->MoveTargetedHome();
|
||||
if(!i_creature.GetCharmerOrOwner())
|
||||
{
|
||||
// Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
|
||||
if( i_creature.GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
|
||||
i_creature.GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
else if (i_creature.GetOwner() && i_creature.GetOwner()->isAlive())
|
||||
i_creature.GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user