Core/Auras: Fixed iterator invalidation crash in Unit::CalcHealAbsorb

Port From (https://github.com/TrinityCore/TrinityCore/commit/c5bd2ceda4834fdf88351016b66f1e23b7888de3)
This commit is contained in:
hondacrx
2023-01-05 17:30:05 -05:00
parent 7d6b86fb2e
commit ae33646702
+2 -2
View File
@@ -3423,7 +3423,7 @@ namespace Game.Entities
tempAbsorb = (uint)currentAbsorb; tempAbsorb = (uint)currentAbsorb;
absorbAurEff.GetBase().CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, damageInfo, ref tempAbsorb); absorbAurEff.GetBase().CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, damageInfo, ref tempAbsorb);
// Check if our aura is using amount to count damage // Check if our aura is using amount to count heal
if (absorbAurEff.GetAmount() >= 0) if (absorbAurEff.GetAmount() >= 0)
{ {
// Reduce shield amount // Reduce shield amount
@@ -3641,7 +3641,7 @@ namespace Game.Entities
absorbAurEff.ChangeAmount(absorbAurEff.GetAmount() - currentAbsorb); absorbAurEff.ChangeAmount(absorbAurEff.GetAmount() - currentAbsorb);
// Aura cannot absorb anything more - remove it // Aura cannot absorb anything more - remove it
if (absorbAurEff.GetAmount() <= 0) if (absorbAurEff.GetAmount() <= 0)
absorbAurEff.GetBase().Remove(AuraRemoveMode.EnemySpell); existExpired = true;
} }
} }