From f1fc76f58cd15bfb37d00ca8931ee30c5746900c Mon Sep 17 00:00:00 2001 From: insunaa Date: Sat, 13 Jan 2024 18:47:32 +0100 Subject: [PATCH] Spells: Ensure that Corruption and Seed of Corruption are interchangeable --- src/game/Entities/Unit.cpp | 2 +- src/game/Spells/SpellMgr.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index 91b13eb89d8..d198fa30f82 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -5633,7 +5633,7 @@ bool Unit::RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder* holder) { // holder cannot remove higher/stronger rank if it isn't from the same caster // judgement excluded due to invalid comparison of dummy auras - if (specific != SPELL_JUDGEMENT && IsSimilarExistingAuraStronger(holder, existing)) // TROLOLO + if (!IsSpellSpecificInterchangeable(specific) && IsSimilarExistingAuraStronger(holder, existing)) // TROLOLO return false; if (!diminished && sSpellMgr.IsSpellAnotherRankOfSpell(spellId, existingSpellId) && sSpellMgr.IsSpellHigherRankOfSpell(existingSpellId, spellId)) diff --git a/src/game/Spells/SpellMgr.h b/src/game/Spells/SpellMgr.h index 53cb74accdd..ac82f335104 100644 --- a/src/game/Spells/SpellMgr.h +++ b/src/game/Spells/SpellMgr.h @@ -2068,6 +2068,18 @@ inline bool IsSpellSpecificIdentical(SpellSpecific specific, SpellSpecific speci return false; } +inline bool IsSpellSpecificInterchangeable(SpellSpecific specific) +{ + switch (specific) + { + case SPELL_CORRUPTION_DEBUFF: + case SPELL_JUDGEMENT: + return true; + default: break; + } + return false; +} + inline bool IsSimilarAuraEffect(SpellEntry const* entry, uint32 effect, SpellEntry const* entry2, uint32 effect2) { return (entry2->EffectApplyAuraName[effect2] && entry->EffectApplyAuraName[effect] &&