aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsilinoron <none@none>2010-09-19 16:48:15 -0700
committersilinoron <none@none>2010-09-19 16:48:15 -0700
commit171fcfa963e3e85489cf3e6f96b5ba40724366f6 (patch)
tree3560c727083a6b237c9eae554f29cd43c8deaf47 /src
parent7070ab49fec5a48edd3c26a26d6a2976878c5448 (diff)
Core/Unit: Do not allow game masters to be damaged.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index db6a3e23975..e80737e0dfd 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -575,6 +575,8 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
{
if (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsAIEnabled)
pVictim->ToCreature()->AI()->DamageTaken(this, damage);
+ else if (pVictim->GetTypeId() == TYPEID_PLAYER && pVictim->ToPlayer()->isGameMaster())
+ return 0;
if (GetTypeId() == TYPEID_UNIT && this->ToCreature()->IsAIEnabled)
this->ToCreature()->AI()->DamageDealt(pVictim, damage);
@@ -720,12 +722,8 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
pVictim->ModifyHealth(- (int32)damage);
if (damagetype == DIRECT_DAMAGE || damagetype == SPELL_DIRECT_DAMAGE)
- {
- //TODO: This is from procflag, I do not know which spell needs this
- //Maim?
- //if (!spellProto || !(spellProto->AuraInterruptFlags&AURA_INTERRUPT_FLAG_DIRECT_DAMAGE))
- pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DIRECT_DAMAGE, spellProto ? spellProto->Id : 0);
- }
+ pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DIRECT_DAMAGE, spellProto ? spellProto->Id : 0);
+
if (pVictim->GetTypeId() != TYPEID_PLAYER)
{
if (spellProto && IsDamageToThreatSpell(spellProto))