diff options
| -rw-r--r-- | src/game/PetAI.cpp | 5 | ||||
| -rw-r--r-- | src/game/PetHandler.cpp | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index 61446220192..fb1b3121090 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -65,9 +65,12 @@ void PetAI::MoveInLineOfSight(Unit *u) void PetAI::AttackStart(Unit *u) { - if( inCombat || !u || (i_pet.isPet() && ((Pet&)i_pet).getPetType() == MINI_PET) ) + if( !u || (i_pet.isPet() && ((Pet&)i_pet).getPetType() == MINI_PET) ) return; + if (inCombat && i_pet.getVictim() && u != i_pet.getVictim()) + i_pet.AttackStop(); + if(i_pet.Attack(u,true)) { i_pet.clearUnitState(UNIT_STAT_FOLLOW); diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 60a4bec0891..ac198c0be67 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -104,9 +104,6 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) if( GetPlayer()->IsFriendlyTo(TargetUnit)) return; - if(pet->getVictim()) - pet->AttackStop(); - if(pet->GetTypeId() != TYPEID_PLAYER) { if (((Creature*)pet)->AI()) @@ -123,6 +120,9 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) } else // charmed player { + if(pet->getVictim() && pet->getVictim() != TargetUnit) + pet->AttackStop(); + pet->Attack(TargetUnit,true); pet->SendPetAIReaction(guid1); } |
