From 6669fc8214fe3d189137ac7406c859981dcf2ae5 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Thu, 14 Oct 2021 23:30:34 -0400 Subject: [PATCH] [Bug Fix] Healing pets not correctly dropping out of combat status (#1603) * Fix for pets not correctly triggering in combat timers * Update spells.cpp --- zone/spells.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index b7affc35f..49b430c6f 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4036,11 +4036,21 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes spelltar->SetHateAmountOnEnt(this, std::max(newhate, 1)); } } else if (IsBeneficialSpell(spell_id) && !IsSummonPCSpell(spell_id)) { - if (this != spelltar && spelltar->IsClient() && IsClient()) - CastToClient()->UpdateRestTimer(spelltar->CastToClient()->GetRestTimer()); + if (this != spelltar && IsClient()){ + if (spelltar->IsClient()) { + CastToClient()->UpdateRestTimer(spelltar->CastToClient()->GetRestTimer()); + } + else if (spelltar->IsPet()) { + Mob *owner = spelltar->GetOwner(); + if (owner && owner != this && owner->IsClient()) { + CastToClient()->UpdateRestTimer(owner->CastToClient()->GetRestTimer()); + } + } + } + entity_list.AddHealAggro( - spelltar, this, - CheckHealAggroAmount(spell_id, spelltar, (spelltar->GetMaxHP() - spelltar->GetHP()))); + spelltar, this, + CheckHealAggroAmount(spell_id, spelltar, (spelltar->GetMaxHP() - spelltar->GetHP()))); } // make sure spelltar is high enough level for the buff