diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 12 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.h | 1 | ||||
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 401c2b2751c..210d14edc40 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -151,7 +151,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint32 effMask) }; if (GetBase()->GetSpellInfo()->HasAttribute(SPELL_ATTR8_AURA_POINTS_ON_CLIENT) - || std::find_if(GetBase()->GetAuraEffects().begin(), GetBase()->GetAuraEffects().end(), std::cref(effectNeedsAmount)) != GetBase()->GetAuraEffects().end()) + || std::ranges::any_of(GetBase()->GetAuraEffects(), effectNeedsAmount)) _flags |= AFLAG_SCALABLE; if ((_flags & AFLAG_POSITIVE)) @@ -219,6 +219,16 @@ void AuraApplication::UpdateApplyEffectMask(uint32 newEffMask, bool canHandleNew _HandleEffect(i, true); } +void AuraApplication::AddEffectToApplyEffectMask(SpellEffIndex spellEffectIndex) +{ + if (_effectsToApply & (1 << spellEffectIndex)) + return; + + _effectsToApply |= 1 << spellEffectIndex; + if (Aura::EffectTypeNeedsSendingAmount(GetBase()->GetEffect(spellEffectIndex)->GetAuraType())) + _flags |= AFLAG_SCALABLE; +} + void AuraApplication::SetNeedClientUpdate() { if (_needClientUpdate || GetRemoveMode() != AURA_REMOVE_NONE) diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index b677d32cf15..107dd2fe0e6 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -86,6 +86,7 @@ class TC_GAME_API AuraApplication uint32 GetEffectsToApply() const { return _effectsToApply; } void UpdateApplyEffectMask(uint32 newEffMask, bool canHandleNewEffects); + void AddEffectToApplyEffectMask(SpellEffIndex spellEffectIndex); void SetRemoveMode(AuraRemoveMode mode) { _removeMode = mode; } AuraRemoveMode GetRemoveMode() const { return _removeMode; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 30f75c86cb8..d2c8b9c6c84 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1077,7 +1077,7 @@ void Spell::EffectApplyAura() if (!aurApp) aurApp = unitTarget->_CreateAuraApplication(_spellAura, 1 << effectInfo->EffectIndex); else - aurApp->UpdateApplyEffectMask(aurApp->GetEffectsToApply() | 1 << effectInfo->EffectIndex, false); + aurApp->AddEffectToApplyEffectMask(effectInfo->EffectIndex); } void Spell::EffectUnlearnSpecialization() |