From d195c09f56586ada3bdb01ca05d36a86697b3984 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 27 Mar 2022 06:50:29 +0200 Subject: [PATCH] fix(Core/Spells): Fixed an issue with Premeditation removing itself. (#11093) Co-authored-by: Treeston --- src/server/game/Entities/Unit/Unit.cpp | 4 ---- src/server/game/Spells/Spell.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 51cac6623..f81c04b5e 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16288,10 +16288,6 @@ void Unit::AddComboPoints(Unit* target, int8 count) return; } - // remove Premed-like effects - // (NB: this Aura removes the already-added CP when it expires from duration - now that we've added CP, this shouldn't happen anymore) - RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS); - if (target && target != m_comboTarget) { if (m_comboTarget) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5aae2c6f0..86c876c0a 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4039,6 +4039,13 @@ void Spell::_handle_finish_phase() // Real add combo points from effects if (m_comboTarget && m_comboPointGain) { + // remove Premed-like effects unless they were caused by ourselves + // (this Aura removes the already-added CP when it expires from duration - now that we've added CP, this shouldn't happen anymore!) + if (!m_spellInfo->HasAura(SPELL_AURA_RETAIN_COMBO_POINTS)) + { + m_caster->RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS); + } + m_caster->AddComboPoints(m_comboTarget, m_comboPointGain); }