diff options
author | megamage <none@none> | 2009-04-30 16:31:05 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-30 16:31:05 -0500 |
commit | 48dab8af91eadec76f59d0cd3d99fc7fca3a69e9 (patch) | |
tree | 97dbed833e095599a50d5877aa8c4943660d9fb1 /src/game/PetHandler.cpp | |
parent | d6b1013763a4405ec844ace19398c2bda5b5940e (diff) | |
parent | eb9328e4dbd5e136728f90ae794da1066688953f (diff) |
*Merge.
--HG--
branch : trunk
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 79cb16e0637..6576a2a7622 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -116,20 +116,20 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid //TODO: Send proper error message to client return; } + // only place where pet can be player - pet->clearUnitState(UNIT_STAT_FOLLOW); - const uint64& selguid = _player->GetSelection(); - Unit *TargetUnit = ObjectAccessor::GetUnit(*_player, selguid); + Unit *TargetUnit = ObjectAccessor::GetUnit(*_player, guid2); if(!TargetUnit) return; - // not let attack friendly units. - if(GetPlayer()->IsFriendlyTo(TargetUnit)) + if(!pet->canAttack(TargetUnit)) return; + // Not let attack through obstructions //if(!pet->IsWithinLOSInMap(TargetUnit)) // return; + pet->clearUnitState(UNIT_STAT_FOLLOW); // This is true if pet has no target or has target but targets differs. if(pet->getVictim() != TargetUnit) { |