From 777b287dff8bce806849a26d59fe40f864c385ed Mon Sep 17 00:00:00 2001 From: MrSmite Date: Thu, 6 Dec 2012 09:58:32 -0500 Subject: 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 --- src/server/game/Handlers/PetHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/server/game/Handlers/PetHandler.cpp') 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); -- cgit v1.2.3