Jump to content

[10672] correct work [Demonic Sacrifice] in sanctuary regions


Guest mns

Recommended Posts

Bug : when use http://www.wowhead.com/spell=18788 in sanctuary regions then pet not Sacrifice !

Caused commit : [s0225] Prevent damage player in sanctuary by pet or other controlled unit.

in fact player must authoritative to Sacrifice own pet .

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 73d8d7e..fe8d1f6 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -508,7 +508,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa

    //You don't lose health from damage taken from another player while in a sanctuary
    //You still see it in the combat log though
-    if (pVictim != this && IsCharmerOrOwnerPlayerOrPlayerItself() && pVictim->IsCharmerOrOwnerPlayerOrPlayerItself())
+    if (pVictim != this && IsCharmerOrOwnerPlayerOrPlayerItself() && pVictim->IsCharmerOrOwnerPlayerOrPlayerItself() && pVictim->GetOwner() != this)
    {
        const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId());
        if (area && area->flags & AREA_FLAG_SANCTUARY)      //sanctuary

Now works properly in sanctuary regions

Note : This spell expired for master branch and not need commit in master if not etc restriction .

Link to comment
Share on other sites

  • 4 weeks later...

Just for note: pVictim->GetOwner() != this not good way check in like cases. GetOwner, GetPet, Get* etc _search_ object pointer in guids map, so useless lost time when you can compare pVictim->GetOwnerGuid() != GetObjectGuid()

With this fix and move repeating code to new function in [10672]. Thank you ;)

I will backport to 0.12 in my next backporting run...

Link to comment
Share on other sites

×
×
  • 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