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 697e4ed5cb4..9a21e6514fd 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; } @@ -212,6 +212,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 2852c959a5b..9f46f295fdb 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 b3bea4b8882..037c2728b6b 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1091,7 +1091,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() |
