[Spells] Fix to prevent Charmed Pets from continuing fight target if owner is dead. (#1600)

* Fix for charm break if pet owner dead

* fix, can't check hatelist it is already wiped.

* Update spell_effects.cpp
This commit is contained in:
KayenEQ
2021-10-16 00:22:07 -04:00
committed by GitHub
parent 5235dcee95
commit af5cfb9bed
2 changed files with 53 additions and 19 deletions
+6
View File
@@ -1684,11 +1684,17 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQ::skills::Skill
// #2: figure out things that affect the player dying and mark them dead
InterruptSpell();
Mob* m_pet = GetPet();
SetPet(0);
SetHorseId(0);
ShieldAbilityClearVariables();
dead = true;
if (m_pet && m_pet->IsCharmed()) {
m_pet->BuffFadeByEffect(SE_Charm);
}
if (GetMerc()) {
GetMerc()->Suspend();
}