Jump to content

[8010][fix] Show overheal in combat log


Guest DonTomika

Recommended Posts

What bug does the patch fix? What features does the patch add?

This patch fixes the bug that overhealing doesn't displayed in the combat log.

For which repository revision was the patch created?

7966

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

Didn't find any.

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 4b693b4..a79c1d0 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7562,9 +7562,10 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro
{
    int32 gain = pVictim->ModifyHealth(int32(addhealth));

-    if (GetTypeId()==TYPEID_PLAYER)
+    if (GetTypeId() == TYPEID_PLAYER)
    {
-        SendHealSpellLog(pVictim, spellProto->Id, addhealth, critical);
+        // gain is always <= addhealth
+        SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth - gain, critical);

        if (BattleGround *bg = ((Player*)this)->GetBattleGround())
            bg->UpdatePlayerScore((Player*)this, SCORE_HEALING_DONE, gain);
@@ -7613,7 +7614,7 @@ Unit* Unit::SelectMagnetTarget(Unit *victim, SpellEntry const *spellInfo)
    return victim;
}

-void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical)
+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));
@@ -7621,7 +7622,7 @@ void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool c
    data.append(GetPackGUID());
    data << uint32(SpellID);
    data << uint32(Damage);
-    data << uint32(0);                                      // over healing?
+    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 d6dac29..482a59d 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1117,7 +1117,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
        virtual bool IsUnderWater() const;
        bool isInAccessablePlaceFor(Creature const* c) const;

-        void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical = false);
+        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, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);

Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use