diff options
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 67d62eeb8de..713d33eb30d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -944,11 +944,8 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons if (damageTaken >= victim->CountPctFromMaxHealth(100 + absorbAurEff->GetMiscValueB())) continue; - // get amount which can be still absorbed by the aura - int32 currentAbsorb = absorbAurEff->GetAmount(); - // aura with infinite absorb amount - let the scripts handle absorbtion amount, set here to 0 for safety - if (currentAbsorb < 0) - currentAbsorb = 0; + // absorb all damage by default + uint32 currentAbsorb = damageInfo.GetDamage(); uint32 tempAbsorb = uint32(currentAbsorb); @@ -957,10 +954,14 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons bool deathFullyPrevented = false; absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb, deathFullyPrevented); - currentAbsorb = tempAbsorb; // absorb must be smaller than the damage itself - currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(damageInfo.GetDamage())); + currentAbsorb = std::min(currentAbsorb, damageInfo.GetDamage()); + + // if nothing is absorbed (for example because of a scripted cooldown) then skip this aura and proceed with dying + if (!currentAbsorb) + continue; + damageInfo.AbsorbDamage(currentAbsorb); if (deathFullyPrevented) |
