From e766102457047ee0b9cf714676cebd3efe9ec7e2 Mon Sep 17 00:00:00 2001 From: Chipleo Date: Sun, 19 Sep 2010 02:22:58 +0400 Subject: [PATCH] [10504] Prevent damage player in sanctuary by pet or other controlled unit. Signed-off-by: VladimirMangos --- src/game/Unit.cpp | 14 +++++++------- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 2754e724b..e645350e7 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -489,10 +489,10 @@ void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb) //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 && GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER) + if (pVictim != this && IsCharmerOrOwnerPlayerOrPlayerItself() && pVictim->IsCharmerOrOwnerPlayerOrPlayerItself()) { const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId()); - if(area && area->flags & AREA_FLAG_SANCTUARY) //sanctuary + if (area && area->flags & AREA_FLAG_SANCTUARY) //sanctuary { if(absorb) *absorb += damage; @@ -1308,10 +1308,10 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss) //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 && GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER) + if (pVictim != this && IsCharmerOrOwnerPlayerOrPlayerItself() && pVictim->IsCharmerOrOwnerPlayerOrPlayerItself()) { const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId()); - if(area && area->flags & AREA_FLAG_SANCTUARY) // sanctuary + if (area && area->flags & AREA_FLAG_SANCTUARY) // sanctuary return; } @@ -1612,17 +1612,17 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) //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 && GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER) + if (pVictim != this && IsCharmerOrOwnerPlayerOrPlayerItself() && pVictim->IsCharmerOrOwnerPlayerOrPlayerItself()) { const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId()); - if(area && area->flags & AREA_FLAG_SANCTUARY) // sanctuary + if (area && area->flags & AREA_FLAG_SANCTUARY) // sanctuary return; } // Hmmmm dont like this emotes client must by self do all animations if (damageInfo->HitInfo&HITINFO_CRITICALHIT) pVictim->HandleEmoteCommand(EMOTE_ONESHOT_WOUNDCRITICAL); - if(damageInfo->blocked_amount && damageInfo->TargetState!=VICTIMSTATE_BLOCKS) + if (damageInfo->blocked_amount && damageInfo->TargetState!=VICTIMSTATE_BLOCKS) pVictim->HandleEmoteCommand(EMOTE_ONESHOT_PARRYSHIELD); if(damageInfo->TargetState == VICTIMSTATE_PARRY) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7b7d15290..29fa3831f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10503" + #define REVISION_NR "10504" #endif // __REVISION_NR_H__