From 6f7998cbaf94e80d92da6d128a5f11b0652ae0a3 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 14 Jun 2009 10:14:01 -0500 Subject: *Use overheal as parameter instead of gain. Author: DonTomika --HG-- branch : trunk --- src/game/Unit.cpp | 7 ++++--- src/game/Unit.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 88c3630be22..3628b956a54 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8713,7 +8713,8 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro if (GetTypeId()==TYPEID_PLAYER) { - SendHealSpellLog(pVictim, spellProto->Id, addhealth, critical, gain); + // overheal = addhealth - gain + SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth > gain ? addhealth - gain : 0, critical); if (BattleGround *bg = ((Player*)this)->GetBattleGround()) bg->UpdatePlayerScore((Player*)this, SCORE_HEALING_DONE, gain); @@ -8917,7 +8918,7 @@ void Unit::UnsummonAllTotems() } } -void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical, int32 gain) +void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, bool critical) { // we guess size WorldPacket data(SMSG_SPELLHEALLOG, (8+8+4+4+1)); @@ -8925,7 +8926,7 @@ void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool c data.append(GetPackGUID()); data << uint32(SpellID); data << uint32(Damage); - data << uint32((int32)Damage > gain ? (int32)Damage - gain : 0); // overheal + data << uint32(OverHeal); data << uint8(critical ? 1 : 0); data << uint8(0); // unused in client? SendMessageToSet(&data, true); diff --git a/src/game/Unit.h b/src/game/Unit.h index f5bc3fa1a1e..4be68c99354 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1273,7 +1273,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject virtual bool IsUnderWater() const; bool isInAccessiblePlaceFor(Creature const* c) const; - void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical, int32 gain); + void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, bool critical = false); void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype); uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage); void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0); -- cgit v1.2.3