Changeset 191

Show
Ignore:
Timestamp:
11/19/08 13:44:57 (17 years ago)
Author:
yumileroy
Message:

[svn] Fixed pets stopping attack after pressing the attack button multiple times.

Original author: gvcoman
Date: 2008-11-07 18:46:25-06:00

Location:
trunk/src/game
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/PetAI.cpp

    r186 r191  
    6666void PetAI::AttackStart(Unit *u) 
    6767{ 
    68     if( inCombat || !u || (i_pet.isPet() && ((Pet&)i_pet).getPetType() == MINI_PET) ) 
    69         return; 
     68    if( !u || (i_pet.isPet() && ((Pet&)i_pet).getPetType() == MINI_PET) ) 
     69        return; 
     70 
     71    if (inCombat && i_pet.getVictim() && u != i_pet.getVictim()) 
     72        i_pet.AttackStop(); 
    7073 
    7174    if(i_pet.Attack(u,true)) 
  • trunk/src/game/PetHandler.cpp

    r174 r191  
    105105                        return; 
    106106 
    107                     if(pet->getVictim()) 
    108                         pet->AttackStop(); 
    109  
    110107                    if(pet->GetTypeId() != TYPEID_PLAYER) 
    111108                    { 
     
    124121                    else                                    // charmed player 
    125122                    { 
     123                        if(pet->getVictim() && pet->getVictim() != TargetUnit) 
     124                            pet->AttackStop(); 
     125 
    126126                        pet->Attack(TargetUnit,true); 
    127127                        pet->SendPetAIReaction(guid1);