Skip to content

Instantly share code, notes, and snippets.

@Nighoo
Created January 28, 2012 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nighoo/1694390 to your computer and use it in GitHub Desktop.
Save Nighoo/1694390 to your computer and use it in GitHub Desktop.
Pet System, self damage
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 76ab5d9..1bbbc2f 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5161,7 +5161,8 @@ void Unit::AttackedBy(Unit* attacker)
// trigger pet AI reaction
if (Pet* pet = GetPet())
- pet->AttackedBy(attacker);
+ if (this != attacker)
+ pet->AttackedBy(attacker);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment