[Bug Fix] Healing pets not correctly dropping out of combat status (#1603)

* Fix for pets not correctly triggering in combat timers

* Update spells.cpp
This commit is contained in:
KayenEQ 2021-10-14 23:30:34 -04:00 committed by GitHub
parent cef873f793
commit 6669fc8214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4036,11 +4036,21 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes
spelltar->SetHateAmountOnEnt(this, std::max(newhate, 1)); spelltar->SetHateAmountOnEnt(this, std::max(newhate, 1));
} }
} else if (IsBeneficialSpell(spell_id) && !IsSummonPCSpell(spell_id)) { } else if (IsBeneficialSpell(spell_id) && !IsSummonPCSpell(spell_id)) {
if (this != spelltar && spelltar->IsClient() && IsClient()) if (this != spelltar && IsClient()){
CastToClient()->UpdateRestTimer(spelltar->CastToClient()->GetRestTimer()); 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( entity_list.AddHealAggro(
spelltar, this, spelltar, this,
CheckHealAggroAmount(spell_id, spelltar, (spelltar->GetMaxHP() - spelltar->GetHP()))); CheckHealAggroAmount(spell_id, spelltar, (spelltar->GetMaxHP() - spelltar->GetHP())));
} }
// make sure spelltar is high enough level for the buff // make sure spelltar is high enough level for the buff