Misc/Util: Add a template function for returning a random element from any container
This commit is contained in:
@@ -934,11 +934,8 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
|
||||
|
||||
// Select a random dungeon from the compatible list
|
||||
// TODO - Select the dungeon based on group item Level, not just random
|
||||
LfgDungeonSet::const_iterator itDungeon = compatibleDungeons.begin();
|
||||
std::advance(itDungeon, urand(0, compatibleDungeons.size() - 1));
|
||||
|
||||
// Create a new proposal
|
||||
pProposal = new LfgProposal(*itDungeon);
|
||||
pProposal = new LfgProposal(SelectRandomContainerElement(compatibleDungeons));
|
||||
pProposal->cancelTime = time_t(time(NULL)) + LFG_TIME_PROPOSAL;
|
||||
pProposal->state = LFG_PROPOSAL_INITIATING;
|
||||
pProposal->queues = check;
|
||||
|
||||
Reference in New Issue
Block a user