mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 23:26:37 +01:00
*Fix a bug that owner cannot recall pet when pet is attacking target.
--HG-- branch : trunk
This commit is contained in:
@@ -1014,10 +1014,6 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
|
||||
//Check if we are in combat (also updates calls threat update code)
|
||||
bool Combat = UpdateVictim();
|
||||
|
||||
//Must return if creature isn't alive. Normally select hostil target and get victim prevent this
|
||||
if (!m_creature->isAlive())
|
||||
return;
|
||||
|
||||
if (!bEmptyList)
|
||||
{
|
||||
//Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
|
||||
|
||||
@@ -87,9 +87,6 @@ void PetAI::_stopAttack()
|
||||
|
||||
void PetAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->isAlive())
|
||||
return;
|
||||
|
||||
Unit* owner = m_creature->GetCharmerOrOwner();
|
||||
|
||||
if(m_updateAlliesTimer <= diff)
|
||||
@@ -110,17 +107,12 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
else if(owner && m_creature->GetCharmInfo()) //no victim
|
||||
{
|
||||
if(me->isInCombat())
|
||||
_stopAttack();
|
||||
else if(owner && m_creature->GetCharmInfo()) //no victim
|
||||
{
|
||||
if(owner->isInCombat() && !(m_creature->HasReactState(REACT_PASSIVE) || m_creature->GetCharmInfo()->HasCommandState(COMMAND_STAY)))
|
||||
AttackStart(owner->getAttackerForHelper());
|
||||
else if(m_creature->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW) && !m_creature->hasUnitState(UNIT_STAT_FOLLOW))
|
||||
m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
|
||||
}
|
||||
if(owner->isInCombat() && !(m_creature->HasReactState(REACT_PASSIVE) || m_creature->GetCharmInfo()->HasCommandState(COMMAND_STAY)))
|
||||
AttackStart(owner->getAttackerForHelper());
|
||||
else if(m_creature->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW) && !m_creature->hasUnitState(UNIT_STAT_FOLLOW))
|
||||
m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
|
||||
}
|
||||
|
||||
if(!me->GetCharmInfo())
|
||||
|
||||
Reference in New Issue
Block a user