Core/Auras: Added serverside checking for UNIT_FLAG_PACIFIED when attempting to start melee attack

Closes #8623
This commit is contained in:
Shauren
2013-10-22 17:09:41 +02:00
parent 3e12fe84c8
commit 06f5011071
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -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)
{
@@ -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