[svn] Fixed pets stopping attack after pressing the attack button multiple times.
--HG-- branch : trunk
This commit is contained in:
+4
-1
@@ -65,9 +65,12 @@ void PetAI::MoveInLineOfSight(Unit *u)
|
|||||||
|
|
||||||
void PetAI::AttackStart(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;
|
return;
|
||||||
|
|
||||||
|
if (inCombat && i_pet.getVictim() && u != i_pet.getVictim())
|
||||||
|
i_pet.AttackStop();
|
||||||
|
|
||||||
if(i_pet.Attack(u,true))
|
if(i_pet.Attack(u,true))
|
||||||
{
|
{
|
||||||
i_pet.clearUnitState(UNIT_STAT_FOLLOW);
|
i_pet.clearUnitState(UNIT_STAT_FOLLOW);
|
||||||
|
|||||||
@@ -104,9 +104,6 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
|||||||
if( GetPlayer()->IsFriendlyTo(TargetUnit))
|
if( GetPlayer()->IsFriendlyTo(TargetUnit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(pet->getVictim())
|
|
||||||
pet->AttackStop();
|
|
||||||
|
|
||||||
if(pet->GetTypeId() != TYPEID_PLAYER)
|
if(pet->GetTypeId() != TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if (((Creature*)pet)->AI())
|
if (((Creature*)pet)->AI())
|
||||||
@@ -123,6 +120,9 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
|||||||
}
|
}
|
||||||
else // charmed player
|
else // charmed player
|
||||||
{
|
{
|
||||||
|
if(pet->getVictim() && pet->getVictim() != TargetUnit)
|
||||||
|
pet->AttackStop();
|
||||||
|
|
||||||
pet->Attack(TargetUnit,true);
|
pet->Attack(TargetUnit,true);
|
||||||
pet->SendPetAIReaction(guid1);
|
pet->SendPetAIReaction(guid1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user