[11930] Fix Pet behaviour for environmental damage

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2012-03-28 22:13:52 +02:00
parent a8c5ba581c
commit af47f39a4e
2 changed files with 5 additions and 1 deletions

View file

@ -5686,6 +5686,10 @@ void Unit::AttackedBy(Unit* attacker)
if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->AI())
((Creature*)this)->AI()->AttackedBy(attacker);
// do not pet reaction for self inflicted damage (like environmental)
if (attacker == this)
return;
// trigger pet AI reaction
if (Pet* pet = GetPet())
pet->AttackedBy(attacker);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11929"
#define REVISION_NR "11930"
#endif // __REVISION_NR_H__