diff options
Diffstat (limited to 'src/game/PetHandler.cpp')
| -rw-r--r-- | src/game/PetHandler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 05c889b8cf9..b87193b7e9f 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -118,10 +118,9 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) //if(!pet->IsWithinLOSInMap(TargetUnit)) // return; - if(pet->GetTypeId() != TYPEID_PLAYER) + if(pet->GetTypeId() != TYPEID_PLAYER && ((Creature*)pet)->IsAIEnabled) { - if (((Creature*)pet)->AI()) - ((Creature*)pet)->AI()->AttackStart(TargetUnit); + ((Creature*)pet)->AI()->AttackStart(TargetUnit); //10% chance to play special pet attack talk, else growl if(((Creature*)pet)->isPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && urand(0, 100) < 10) @@ -165,7 +164,8 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) case REACT_PASSIVE: //passive case REACT_DEFENSIVE: //recovery case REACT_AGGRESSIVE: //activete - charmInfo->SetReactState( ReactStates(spellid) ); + if(pet->GetTypeId() == TYPEID_UNIT) + ((Creature*)pet)->SetReactState( ReactStates(spellid) ); break; } break; @@ -241,7 +241,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) if(pet->getVictim()) pet->AttackStop(); pet->GetMotionMaster()->Clear(); - if (((Creature*)pet)->AI()) + if (((Creature*)pet)->IsAIEnabled) ((Creature*)pet)->AI()->AttackStart(unit_target); } |
