fix(Core/Entities): extend combo point system to all Units (#9816)

- Closes #1140
This commit is contained in:
UltraNix
2022-01-07 11:18:03 +01:00
committed by GitHub
parent 2e6213d526
commit 2c6a692000
9 changed files with 217 additions and 182 deletions

View File

@@ -4995,9 +4995,8 @@ void AuraEffect::HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint
// combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
// remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
if (!(apply) && GetBase()->GetDuration() == 0 && target->ToPlayer()->GetComboTarget())
if (Unit* unit = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget()))
target->ToPlayer()->AddComboPoints(unit, -GetAmount());
if (!(apply) && GetBase()->GetDuration() == 0)
target->AddComboPoints(-GetAmount());
}
/*********************************************************/