aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-01-09 12:36:58 +0100
committerShauren <shauren.trinity@gmail.com>2025-01-09 12:36:58 +0100
commit0a1b81043eaae0e0feba2b693e1f004ac4791c30 (patch)
tree03a7b5b9686ae4b57e55b55967b1cf6451d24d39 /src
parentda1ac5aa73afdb7f2379b71761e2a6e855ce4e9a (diff)
Core/Auras: Fixed sending amounts for effects that need it, aren't first and don't have SPELL_ATTR8_AURA_POINTS_ON_CLIENT
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp12
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.h1
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
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()