aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/CreatureEventAI.cpp4
-rw-r--r--src/game/PetAI.cpp18
2 files changed, 5 insertions, 17 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp
index cd6e58361e6..c2ae915c9a4 100644
--- a/src/game/CreatureEventAI.cpp
+++ b/src/game/CreatureEventAI.cpp
@@ -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
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index ae4441d7c6d..a5a3f28c92a 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -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())