aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/PetHandler.cpp
diff options
context:
space:
mode:
authorMrSmite <mrsmite@att.net>2012-12-06 09:58:32 -0500
committerMrSmite <mrsmite@att.net>2012-12-07 22:13:57 -0500
commit777b287dff8bce806849a26d59fe40f864c385ed (patch)
tree18a9231bd70d014083309b198b293576a3f63630 /src/server/game/Handlers/PetHandler.cpp
parentb9442f3773ad8ab43dcc52b649a4f6d7a4869354 (diff)
PetAI - Overhaul / bug fix
* Aggressive pets now use aggro radius check based on level diff of target * Aggro radius limited to max 45 yards (per wowwiki) * Pets no longer "dance" when fighting a creature * Pets returning will defend themselves (if not passive) if owner didn't click "follow" * Pets at stay will properly pick up their owner's attackers that pass within range * Fix "no empty line at end of file" warning in PetAI * Fix typo in GetAggroRange() * Fix spell "Eyes of the Beast" - player can move pet freely * Code style cleanup * Update commit comment Closes #8398, #7455
Diffstat (limited to 'src/server/game/Handlers/PetHandler.cpp')
-rw-r--r--src/server/game/Handlers/PetHandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 36dacaead69..5e43462b6d0 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -162,6 +162,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
charmInfo->SetIsCommandAttack(false);
charmInfo->SetIsAtStay(true);
+ charmInfo->SetIsCommandFollow(false);
charmInfo->SetIsFollowing(false);
charmInfo->SetIsReturning(false);
charmInfo->SaveStayPosition();
@@ -175,6 +176,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
charmInfo->SetIsCommandAttack(false);
charmInfo->SetIsAtStay(false);
charmInfo->SetIsReturning(true);
+ charmInfo->SetIsCommandFollow(true);
charmInfo->SetIsFollowing(false);
break;
case COMMAND_ATTACK: //spellid=1792 //ATTACK
@@ -215,6 +217,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
charmInfo->SetIsCommandAttack(true);
charmInfo->SetIsAtStay(false);
charmInfo->SetIsFollowing(false);
+ charmInfo->SetIsCommandFollow(false);
charmInfo->SetIsReturning(false);
pet->ToCreature()->AI()->AttackStart(TargetUnit);
@@ -236,6 +239,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
charmInfo->SetIsCommandAttack(true);
charmInfo->SetIsAtStay(false);
charmInfo->SetIsFollowing(false);
+ charmInfo->SetIsCommandFollow(false);
charmInfo->SetIsReturning(false);
pet->Attack(TargetUnit, true);