Core/Players: Remove player from group on faction change if two side interaction group is not allowed.

Port From (https://github.com/TrinityCore/TrinityCore/commit/f108a50abf82abd0973878ef88fdab47a408238c)
This commit is contained in:
hondacrx
2023-09-14 04:36:13 -04:00
parent af4661330a
commit 79cdb32e43
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -1761,6 +1761,7 @@ namespace Game
AtLoginFlags atLoginFlags = (AtLoginFlags)result.Read<ushort>(0);
string knownTitlesStr = result.Read<string>(1);
uint groupId = !result.IsNull(2) ? result.Read<uint>(2) : 0;
AtLoginFlags usedLoginFlag = (factionChangeInfo.FactionChange ? AtLoginFlags.ChangeFaction : AtLoginFlags.ChangeRace);
if (!atLoginFlags.HasAnyFlag(usedLoginFlag))
@@ -1989,6 +1990,13 @@ namespace Game
Player.LeaveAllArenaTeams(factionChangeInfo.Guid);
}
if (groupId != 0 && !WorldConfig.GetBoolValue(WorldCfg.AllowTwoSideInteractionGroup))
{
Group group = Global.GroupMgr.GetGroupByDbStoreId(groupId);
if (group != null)
group.RemoveMember(factionChangeInfo.Guid);
}
if (!HasPermission(RBACPermissions.TwoSideAddFriend))
{
// Delete Friend List