From 8f573ee28d3328215b0a3b425392580a4cd11d54 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 14 Mar 2024 10:56:01 -0400 Subject: [PATCH] Core/Auras: Update visible aura immediately during spell cast instead of waiting for next update tick Port From (https://github.com/TrinityCore/TrinityCore/commit/62dc916184d5d32b26a2d331d84d3cae481040fb) --- Source/Game/Entities/Unit/Unit.Spells.cs | 1 + Source/Game/Spells/Spell.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index 9d5ca192c..5af84f9db 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -4487,5 +4487,6 @@ namespace Game.Entities public SortedSet GetVisibleAuras() { return m_visibleAuras; } public bool HasVisibleAura(AuraApplication aurApp) { return m_visibleAuras.Contains(aurApp); } public void SetVisibleAuraUpdate(AuraApplication aurApp) { m_visibleAurasToUpdate.Add(aurApp); } + public void RemoveVisibleAuraUpdate(AuraApplication aurApp) { m_visibleAurasToUpdate.Remove(aurApp); } } } diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index bbf3fb7f1..36fc27c3e 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -8852,6 +8852,12 @@ namespace Game.Spells if (effMask != 0) _spellHitTarget._ApplyAura(aurApp, effMask); + + if (aurApp.IsNeedClientUpdate() && aurApp.GetRemoveMode() == AuraRemoveMode.None) + { + aurApp.ClientUpdate(false); + _spellHitTarget.RemoveVisibleAuraUpdate(aurApp); + } } }