aboutsummaryrefslogtreecommitdiff
path: root/src/game/PetHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/PetHandler.cpp')
-rw-r--r--src/game/PetHandler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp
index d912f42c22b..7950db27464 100644
--- a/src/game/PetHandler.cpp
+++ b/src/game/PetHandler.cpp
@@ -112,7 +112,10 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
return;
// not let attack friendly units.
- if( GetPlayer()->IsFriendlyTo(TargetUnit))
+ if(GetPlayer()->IsFriendlyTo(TargetUnit))
+ return;
+ // Not let attack through obstructions
+ if(!pet->IsWithinLOSInMap(TargetUnit))
return;
if(pet->GetTypeId() != TYPEID_PLAYER)