From 5e1571062ac05bc3e68ebf1cf9ed04ab54e713bd 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) --- 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 c2cdcbfb641..dd5dcb04f1a 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -3674,29 +3674,26 @@ bool _isPositiveEffectImpl(SpellInfo const* spellInfo, uint8 effIndex, std::unor 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(spellInfo, effIndex)) + if (SpellInfo const* spellTriggeredProto = sSpellMgr->GetSpellInfo(spellInfo->Effects[effIndex].TriggerSpell)) { - if (SpellInfo const* spellTriggeredProto = sSpellMgr->GetSpellInfo(spellInfo->Effects[effIndex].TriggerSpell)) + // negative targets of main spell return early + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - // negative targets of main spell return early - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - // already seen this - if (visited.count({ spellTriggeredProto->Id, i }) > 0) - continue; + // already seen this + if (visited.count({ spellTriggeredProto->Id, i }) > 0) + continue; - if (!spellTriggeredProto->Effects[i].Effect) - continue; + if (!spellTriggeredProto->Effects[i].Effect) + 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(spellTriggeredProto, i) && !_isPositiveEffectImpl(spellTriggeredProto, i, 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(spellTriggeredProto, i) && !_isPositiveEffectImpl(spellTriggeredProto, i, 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