aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGildor <gildor55@gmail.com>2020-07-14 09:43:41 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-23 15:20:09 +0100
commit81154a7455fccdcc55e740f98d73face3adc8da4 (patch)
tree2a987bf1b93a7d8637071b4772918e1060714ae5 /src
parentb6a3774a383b5122b9c3ff75a419c4372daca907 (diff)
Core/Spells: Check a few aura effects for determining if should be negative (#25004)
(cherry picked from commit 5e1571062ac05bc3e68ebf1cf9ed04ab54e713bd)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp29
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: