mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[11930] Fix Pet behaviour for environmental damage
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
a8c5ba581c
commit
af47f39a4e
2 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue