diff options
author | Gildor <gildor55@gmail.com> | 2020-07-14 09:43:41 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-23 15:20:09 +0100 |
commit | 81154a7455fccdcc55e740f98d73face3adc8da4 (patch) | |
tree | 2a987bf1b93a7d8637071b4772918e1060714ae5 | |
parent | b6a3774a383b5122b9c3ff75a419c4372daca907 (diff) |
Core/Spells: Check a few aura effects for determining if should be negative (#25004)
(cherry picked from commit 5e1571062ac05bc3e68ebf1cf9ed04ab54e713bd)
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 65d5349c6fb..32050ac41a2 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -4626,29 +4626,26 @@ bool _isPositiveEffectImpl(SpellInfo const* spellInfo, SpellEffectInfo const& ef return true; case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE: case SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT: - case SPELL_AURA_PERIODIC_TRIGGER_SPELL: - if (!_isPositiveTarget(effect)) + if (SpellInfo const* spellTriggeredProto = sSpellMgr->GetSpellInfo(effect.TriggerSpell, spellInfo->Difficulty)) { - if (SpellInfo const* spellTriggeredProto = sSpellMgr->GetSpellInfo(effect.TriggerSpell, spellInfo->Difficulty)) + // negative targets of main spell return early + for (SpellEffectInfo const& spellTriggeredEffect : spellTriggeredProto->GetEffects()) { - // negative targets of main spell return early - for (SpellEffectInfo const& spellTriggeredEffect : spellTriggeredProto->GetEffects()) - { - // already seen this - if (visited.count({ spellTriggeredProto, spellTriggeredEffect.EffectIndex }) > 0) - continue; + // already seen this + if (visited.count({ spellTriggeredProto, spellTriggeredEffect.EffectIndex }) > 0) + continue; - if (!spellTriggeredEffect.IsEffect()) - continue; + if (!spellTriggeredEffect.IsEffect()) + continue; - // if non-positive trigger cast targeted to positive target this main cast is non-positive - // this will place this spell auras as debuffs - if (_isPositiveTarget(spellTriggeredEffect) && !_isPositiveEffectImpl(spellTriggeredProto, spellTriggeredEffect, visited)) - return false; - } + // if non-positive trigger cast targeted to positive target this main cast is non-positive + // this will place this spell auras as debuffs + if (_isPositiveTarget(spellTriggeredEffect) && !_isPositiveEffectImpl(spellTriggeredProto, spellTriggeredEffect, visited)) + return false; } } break; + case SPELL_AURA_PERIODIC_TRIGGER_SPELL: case SPELL_AURA_MOD_STUN: case SPELL_AURA_TRANSFORM: case SPELL_AURA_MOD_DECREASE_SPEED: |