mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Auras: Fixed sending amounts for effects that need it, aren't first and don't have SPELL_ATTR8_AURA_POINTS_ON_CLIENT
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user