From c07868a99803d3fc70de4cf366a1e17757d81e09 Mon Sep 17 00:00:00 2001 From: zwisus Date: Thu, 2 Feb 2017 15:20:45 +0800 Subject: [PATCH] creature dead unsummon pet. (#6) Signed-off-by: Zwisus --- src/game/Object/Creature.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/Object/Creature.cpp b/src/game/Object/Creature.cpp index 74d4cb29..f5324364 100644 --- a/src/game/Object/Creature.cpp +++ b/src/game/Object/Creature.cpp @@ -1679,6 +1679,11 @@ void Creature::SetDeathState(DeathState s) if (CanFly()) { i_motionMaster.MoveFall(); } + if (Pet* pet = GetPet()) + { + pet->Unsummon(PET_SAVE_AS_DELETED, this); + } + Unit::SetDeathState(CORPSE); }