Core/Auras: unregister AuraEffect from target list before changing amount, forces recalculation at stack change

Port From (https://github.com/TrinityCore/TrinityCore/commit/f51a493dc87c4002aeea84b39679e7dbe379aca5)
This commit is contained in:
hondacrx
2019-09-03 16:03:03 -04:00
parent fff95df0e8
commit 995e04b80d
+16 -6
View File
@@ -238,9 +238,14 @@ namespace Game.Spells
List<AuraApplication> effectApplications = new List<AuraApplication>();
GetApplicationList(out effectApplications);
foreach (var appt in effectApplications)
if (appt.HasEffect(GetEffIndex()))
HandleEffect(appt, handleMask, false);
foreach (var aurApp in effectApplications)
{
if (aurApp.HasEffect(GetEffIndex()))
{
aurApp.GetTarget()._RegisterAuraEffect(this, false);
HandleEffect(aurApp, handleMask, false);
}
}
if (Convert.ToBoolean(handleMask & AuraEffectHandleModes.ChangeAmount))
{
@@ -251,9 +256,14 @@ namespace Game.Spells
CalculateSpellMod();
}
foreach (var appt in effectApplications)
if (appt.HasEffect(GetEffIndex()))
HandleEffect(appt, handleMask, true);
foreach (var aurApp in effectApplications)
{
if (aurApp.HasEffect(GetEffIndex()))
{
aurApp.GetTarget()._RegisterAuraEffect(this, true);
HandleEffect(aurApp, handleMask, true);
}
}
if (GetSpellInfo().HasAttribute(SpellAttr8.AuraSendAmount))
GetBase().SetNeedClientUpdateForTargets();