mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-07-11 03:13:10 +00:00
fix(Core/LFG): resolve multi-role masks in-place during rolecheck (#26125)
This commit is contained in:
@@ -1504,7 +1504,6 @@ namespace lfg
|
||||
if (!gguid)
|
||||
return;
|
||||
|
||||
LfgRolesMap check_roles;
|
||||
LfgRoleCheckContainer::iterator itRoleCheck = RoleChecksStore.find(gguid);
|
||||
if (itRoleCheck == RoleChecksStore.end())
|
||||
return;
|
||||
@@ -1527,9 +1526,7 @@ namespace lfg
|
||||
|
||||
if (itRoles == roleCheck.roles.end())
|
||||
{
|
||||
// use temporal var to check roles, CheckGroupRoles modifies the roles
|
||||
check_roles = roleCheck.roles;
|
||||
roleCheck.state = CheckGroupRoles(check_roles) ? LFG_ROLECHECK_FINISHED : LFG_ROLECHECK_WRONG_ROLES;
|
||||
roleCheck.state = CheckGroupRoles(roleCheck.roles) ? LFG_ROLECHECK_FINISHED : LFG_ROLECHECK_WRONG_ROLES;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1798,14 +1795,17 @@ namespace lfg
|
||||
ObjectGuid gguid = grp->GetGUID();
|
||||
SetState(gguid, LFG_STATE_PROPOSAL);
|
||||
sGroupMgr->AddGroup(grp);
|
||||
grp->SetLfgRoles(pguid, proposal.players.find(pguid)->second.role);
|
||||
}
|
||||
else if (group != grp)
|
||||
{
|
||||
if (!grp->IsFull())
|
||||
grp->AddMember(player);
|
||||
grp->AddMember(player, proposal.players.find(pguid)->second.role);
|
||||
}
|
||||
else
|
||||
{
|
||||
grp->SetLfgRoles(pguid, proposal.players.find(pguid)->second.role);
|
||||
}
|
||||
|
||||
grp->SetLfgRoles(pguid, proposal.players.find(pguid)->second.role);
|
||||
}
|
||||
|
||||
// pussywizard: crashfix, group wasn't created when iterating players (no player found by guid), proposal is deleted by the calling function
|
||||
|
||||
@@ -421,7 +421,7 @@ Player* Group::GetInvited(const std::string& name) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Group::AddMember(Player* player)
|
||||
bool Group::AddMember(Player* player, uint8 roles /* = 0 */)
|
||||
{
|
||||
if (!player)
|
||||
return false;
|
||||
@@ -449,7 +449,7 @@ bool Group::AddMember(Player* player)
|
||||
member.name = player->GetName();
|
||||
member.group = subGroup;
|
||||
member.flags = 0;
|
||||
member.roles = 0;
|
||||
member.roles = roles;
|
||||
m_memberSlots.push_back(member);
|
||||
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
void RemoveInvite(Player* player);
|
||||
void RemoveAllInvites();
|
||||
bool AddLeaderInvite(Player* player);
|
||||
bool AddMember(Player* player);
|
||||
bool AddMember(Player* player, uint8 roles = 0);
|
||||
bool RemoveMember(ObjectGuid guid, const RemoveMethod& method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = nullptr);
|
||||
void ChangeLeader(ObjectGuid guid);
|
||||
void SetLootMethod(LootMethod method);
|
||||
|
||||
Reference in New Issue
Block a user