From 81154a7455fccdcc55e740f98d73face3adc8da4 Mon Sep 17 00:00:00 2001 From: Gildor Date: Tue, 14 Jul 2020 09:43:41 +0200 Subject: Core/Spells: Check a few aura effects for determining if should be negative (#25004) (cherry picked from commit 5e1571062ac05bc3e68ebf1cf9ed04ab54e713bd) --- src/server/game/Spells/SpellInfo.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src') 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: -- cgit v1.2.3