aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2017-04-27 19:35:22 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-04-27 19:35:22 +0200
commit037ffdf60911f369b8472bccfe6a90da9b43d0a5 (patch)
tree94c1fb18bc020134150e1556815d607a29d64057 /src/server/game
parent66744c4b4cc660f598791a28042087d1cbdcb10d (diff)
Fixed warning
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
-rw-r--r--src/server/game/Entities/Unit/Unit.h3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index afafb063d8d..d0f579130fc 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -207,7 +207,7 @@ uint32 DamageInfo::GetHitMask() const
}
HealInfo::HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask)
- : _healer(healer), _target(target), _heal(heal), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
+ : _healer(healer), _target(target), _heal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
{
}
@@ -216,6 +216,8 @@ void HealInfo::AbsorbHeal(uint32 amount)
amount = std::min(amount, GetHeal());
_absorb += amount;
_heal -= amount;
+ amount = std::min(amount, GetEffectiveHeal());
+ _effectiveHeal -= amount;
_hitMask |= PROC_HIT_ABSORB;
}
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index f5213b7b172..d06a48b7992 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -992,6 +992,7 @@ private:
Unit* const _healer;
Unit* const _target;
uint32 _heal;
+ uint32 _effectiveHeal;
uint32 _absorb;
SpellInfo const* const _spellInfo;
SpellSchoolMask const _schoolMask;
@@ -1001,10 +1002,12 @@ public:
explicit HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask);
void AbsorbHeal(uint32 amount);
+ void SetEffectiveHeal(uint32 amount) { _effectiveHeal = amount; }
Unit* GetHealer() const { return _healer; }
Unit* GetTarget() const { return _target; }
uint32 GetHeal() const { return _heal; }
+ uint32 GetEffectiveHeal() const { return _effectiveHeal; }
uint32 GetAbsorb() const { return _absorb; }
SpellInfo const* GetSpellInfo() const { return _spellInfo; };
SpellSchoolMask GetSchoolMask() const { return _schoolMask; };