Core/Spell: Remove all raid auras on party leave (#17663)

Core/Spell: Remove all raid auras on party leave
This commit is contained in:
robinsch
2016-08-14 17:26:03 +02:00
committed by jackpoz
parent c515cdc636
commit dd67f4ed96
5 changed files with 51 additions and 1 deletions

View File

@@ -34,6 +34,7 @@
#include "Util.h"
#include "LFGMgr.h"
#include "UpdateFieldFlags.h"
#include "SpellAuras.h"
Roll::Roll(ObjectGuid _guid, LootItem const& li) : itemGUID(_guid), itemid(li.itemid),
itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count),
@@ -484,6 +485,22 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
sScriptMgr->OnGroupRemoveMember(this, guid, method, kicker, reason);
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
if (player)
{
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
if (Player* groupMember = itr->GetSource())
{
if (groupMember->GetGUID() == guid)
continue;
groupMember->RemoveAllGroupBuffsFromCaster(guid);
player->RemoveAllGroupBuffsFromCaster(groupMember->GetGUID());
}
}
}
// LFG group vote kick handled in scripts
if (isLFGGroup() && method == GROUP_REMOVEMETHOD_KICK)
return !m_memberSlots.empty();
@@ -491,7 +508,6 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
// remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG/BF allow 1 member group)
if (GetMembersCount() > ((isBGGroup() || isLFGGroup() || isBFGroup()) ? 1u : 2u))
{
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
if (player)
{
// Battleground group handling