aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-10-09 21:34:23 +0200
committerMachiavelli <none@none>2009-10-09 21:34:23 +0200
commitafba628188469914ff17ab44e174248672729b00 (patch)
treea3d5e8b44077a9b94901afcefb1cfd27b53756ee /src
parentc13da994effa8266b4fa3aecacf3fe5c859b76fa (diff)
*PetAI update;
Pets now start attacking their owners target in defensive mode as soon as the hunter does (3.0.2 change) Correctly chase target if attack command was given after pet has set gaze on target from defensive mode with chase = false --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/PetAI.cpp4
-rw-r--r--src/game/PetHandler.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index 25125c2a0dc..534500e51ea 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -323,6 +323,10 @@ Unit *PetAI::SelectNextTarget()
if (me->GetCharmerOrOwner()->getAttackerForHelper())
return me->GetCharmerOrOwner()->getAttackerForHelper();
+ // 3.0.2 - Pets now start attacking their owners target in defensive mode as soon as the hunter does
+ if (me->GetCharmerOrOwner()->getVictim())
+ return me->GetCharmerOrOwner()->getVictim();
+
// Default
return NULL;
}
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp
index c9b07823d5f..733a857373b 100644
--- a/src/game/PetHandler.cpp
+++ b/src/game/PetHandler.cpp
@@ -143,7 +143,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
pet->clearUnitState(UNIT_STAT_FOLLOW);
// This is true if pet has no target or has target but targets differs.
- if(pet->getVictim() != TargetUnit)
+ if(pet->getVictim() != TargetUnit || ( pet->getVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack() ))
{
if (pet->getVictim())
pet->AttackStop();