mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 15:17:27 +01:00
Core/Players: Remove player from group on faction change if two side interaction group is not allowed. (#28835)
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "GameTime.h"
|
||||
#include "GitRevision.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
@@ -1673,6 +1674,7 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact
|
||||
Field* fields = result->Fetch();
|
||||
uint32 atLoginFlags = fields[0].GetUInt16();
|
||||
std::string knownTitlesStr = fields[1].GetString();
|
||||
uint32 groupId = !fields[2].IsNull() ? fields[2].GetUInt32() : 0;
|
||||
|
||||
uint32 usedLoginFlag = (factionChangeInfo->FactionChange ? AT_LOGIN_CHANGE_FACTION : AT_LOGIN_CHANGE_RACE);
|
||||
if (!(atLoginFlags & usedLoginFlag))
|
||||
@@ -1881,6 +1883,12 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact
|
||||
Player::LeaveAllArenaTeams(factionChangeInfo->Guid);
|
||||
}
|
||||
|
||||
if (groupId && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
{
|
||||
if (Group* group = sGroupMgr->GetGroupByDbStoreId(groupId))
|
||||
group->RemoveMember(factionChangeInfo->Guid);
|
||||
}
|
||||
|
||||
if (!HasPermission(rbac::RBAC_PERM_TWO_SIDE_ADD_FRIEND))
|
||||
{
|
||||
// Delete Friend List
|
||||
|
||||
Reference in New Issue
Block a user