From 171fcfa963e3e85489cf3e6f96b5ba40724366f6 Mon Sep 17 00:00:00 2001 From: silinoron Date: Sun, 19 Sep 2010 16:48:15 -0700 Subject: Core/Unit: Do not allow game masters to be damaged. --HG-- branch : trunk --- src/server/game/Entities/Unit/Unit.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') 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)) -- cgit v1.2.3