Core/Auras: Fixed sending amounts for effects that need it, aren't first and don't have SPELL_ATTR8_AURA_POINTS_ON_CLIENT

(cherry picked from commit 0a1b81043e)
This commit is contained in:
Shauren
2025-01-09 12:36:58 +01:00
committed by Ovahlord
parent e3ecbbd1b5
commit 08eb6312f2
3 changed files with 13 additions and 2 deletions

View File

@@ -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)

View File

@@ -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; }

View File

@@ -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()