diff options
| author | Shauren <shauren.trinity@gmail.com> | 2020-05-03 16:19:19 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-02 00:30:31 +0100 |
| commit | 6413466693e424ee42744a4cdb8b24502631fa49 (patch) | |
| tree | 8f8418d743d4bbd8aa87d15b508c6cb41536b20d /src | |
| parent | 875da437806b8956324078bc9abd0a495345d2e5 (diff) | |
Core/Spells: Relaxed aura exclusivity check to allow casting spells that have other, non-aura effects even if aura will not be applied
Closes #24553
(cherry picked from commit 829cf38c67a70c1e0ec9886562e7ae7ae4fda17d)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 7 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 5 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 158b9d05e1f..a603303bf5e 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3385,13 +3385,6 @@ void Unit::_RemoveNoStackAurasDueToAura(Aura* aura) if (!IsHighestExclusiveAura(aura)) { - if (!aura->GetSpellInfo()->IsAffectingArea()) - { - Unit* caster = aura->GetCaster(); - if (caster && caster->GetTypeId() == TYPEID_PLAYER) - Spell::SendCastResult(caster->ToPlayer(), aura->GetSpellInfo(), aura->GetSpellVisual(), aura->GetCastId(), SPELL_FAILED_AURA_BOUNCED); - } - aura->Remove(); return; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 01cccc16af3..5e0227891c8 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5574,6 +5574,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 return castResult; uint32 approximateAuraEffectMask = 0; + uint32 nonAuraEffectMask = 0; for (SpellEffectInfo const& spellEffectInfo : m_spellInfo->GetEffects()) { // for effects of spells that have only one target @@ -6134,6 +6135,8 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 if (spellEffectInfo.IsAura()) approximateAuraEffectMask |= 1 << spellEffectInfo.EffectIndex; + else if (spellEffectInfo.IsEffect()) + nonAuraEffectMask |= 1 << spellEffectInfo.EffectIndex; } for (SpellEffectInfo const& spellEffectInfo : m_spellInfo->GetEffects()) @@ -6255,7 +6258,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 } // check if target already has the same type, but more powerful aura - if (!m_spellInfo->IsTargetingArea()) + if (!nonAuraEffectMask && (approximateAuraEffectMask & (1 << spellEffectInfo.EffectIndex)) && !m_spellInfo->IsTargetingArea()) if (Unit* target = m_targets.GetUnitTarget()) if (!target->IsHighestExclusiveAuraEffect(m_spellInfo, spellEffectInfo.ApplyAuraName, spellEffectInfo.CalcValue(m_caster, &m_spellValue->EffectBasePoints[spellEffectInfo.EffectIndex], nullptr, nullptr, m_castItemEntry, m_castItemLevel), |
