From 06f50110713feec2d6957e68ce2c5a5d2a997d6a Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 22 Oct 2013 17:09:41 +0200 Subject: Core/Auras: Added serverside checking for UNIT_FLAG_PACIFIED when attempting to start melee attack Closes #8623 --- src/server/game/Entities/Unit/Unit.cpp | 3 +++ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src/server') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3b924a88feb..c3a611c441f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8914,6 +8914,9 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) if (GetTypeId() == TYPEID_PLAYER && IsMounted()) return false; + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) + return false; + // nobody can attack GM in GM-mode if (victim->GetTypeId() == TYPEID_PLAYER) { diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 4b73af1b681..630d2f28376 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2301,7 +2301,10 @@ void AuraEffect::HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode, Unit* target = aurApp->GetTarget(); if (apply) + { target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED); + target->AttackStop(); + } else { // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit -- cgit v1.2.3