diff options
author | Shauren <shauren.trinity@gmail.com> | 2013-10-22 17:09:41 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2013-10-22 17:09:41 +0200 |
commit | 06f50110713feec2d6957e68ce2c5a5d2a997d6a (patch) | |
tree | 616cc1f499c2f6b612b835d3fadceb20ff0eb1d2 /src | |
parent | 3e12fe84c860567b2a6097b99f202b56aaf51ccf (diff) |
Core/Auras: Added serverside checking for UNIT_FLAG_PACIFIED when attempting to start melee attack
Closes #8623
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 3 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
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 |