Core/Dungeon Finder: fixed logic in dungeon selection

Random number should be generated only once.
This commit is contained in:
LihO
2011-08-04 19:24:11 +02:00
parent d0de7976dc
commit 24bb62ec44

View File

@@ -931,7 +931,8 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
// Select a random dungeon from the compatible list // Select a random dungeon from the compatible list
// TODO - Select the dungeon based on group item Level, not just random // TODO - Select the dungeon based on group item Level, not just random
LfgDungeonSet::const_iterator itDungeon = compatibleDungeons.begin(); LfgDungeonSet::const_iterator itDungeon = compatibleDungeons.begin();
for (uint8 i = 0; i < urand(0, compatibleDungeons.size() - 1); ++i) uint8 rand = urand(0, compatibleDungeons.size() - 1);
for (uint8 i = 0; i < rand; ++i)
++itDungeon; ++itDungeon;
// Create a new proposal // Create a new proposal