mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 00:23:48 +00:00
fix(Core/DungeonFinder): Premade groups should be treated as normal groups. (#8520)
Fixes #8339
This commit is contained in:
@@ -1568,7 +1568,28 @@ namespace lfg
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(proposal.dungeonId);
|
||||
ASSERT(dungeon);
|
||||
|
||||
bool isPremadeGroup = false;
|
||||
Group* grp = proposal.group ? sGroupMgr->GetGroupByGUID(proposal.group.GetCounter()) : nullptr;
|
||||
if (!grp)
|
||||
{
|
||||
ObjectGuid groupGUID;
|
||||
for (ObjectGuid const& guid : players)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
|
||||
{
|
||||
Group* group = player->GetGroup();
|
||||
if (!group || (groupGUID && groupGUID != group->GetGUID()))
|
||||
{
|
||||
isPremadeGroup = false;
|
||||
break;
|
||||
}
|
||||
|
||||
groupGUID = group->GetGUID();
|
||||
isPremadeGroup = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ObjectGuid oldGroupGUID;
|
||||
for (LfgGuidList::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
@@ -1578,6 +1599,13 @@ namespace lfg
|
||||
continue;
|
||||
|
||||
Group* group = player->GetGroup();
|
||||
if (isPremadeGroup && !grp)
|
||||
{
|
||||
oldGroupGUID = group->GetGUID();
|
||||
grp = group;
|
||||
grp->ConvertToLFG(false);
|
||||
SetState(grp->GetGUID(), LFG_STATE_PROPOSAL);
|
||||
}
|
||||
|
||||
// Xinef: Apply Random Buff
|
||||
if (grp && !grp->IsLfgWithBuff())
|
||||
|
||||
Reference in New Issue
Block a user