aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLihO <liho@posterus.cz>2011-08-04 19:24:11 +0200
committerLihO <liho@posterus.cz>2011-08-04 19:24:11 +0200
commit24bb62ec448833bff00fcfc57dccf8add23a12e0 (patch)
tree7c8cc5deb2c26541b73d11e2b96b3bc577bb6490 /src
parentd0de7976dc6273a7e0a9b005707e4d7c04ff139c (diff)
Core/Dungeon Finder: fixed logic in dungeon selection
Random number should be generated only once.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 2fc6e84da4e..c2da032ccdf 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -931,7 +931,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();
- 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;
// Create a new proposal