From 763d59aeec9931acbcbdd1c5f9b0fd3105ace299 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Date: Fri, 5 Aug 2011 21:47:12 -0300 Subject: Core/Dungeon Finder: Added condition to avoid unnecessary checks to the joining result. --- src/server/game/DungeonFinding/LFGMgr.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 9e9603dc5fe..87466436980 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -539,14 +539,18 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon } } - // Expand random dungeons and check restrictions - if (rDungeonId) - dungeons = GetDungeonsByRandom(rDungeonId); + // it could be changed + if (joinData.result == LFG_JOIN_OK) + { + // Expand random dungeons and check restrictions + if (rDungeonId) + dungeons = GetDungeonsByRandom(rDungeonId); - // if we have lockmap then there are no compatible dungeons - GetCompatibleDungeons(dungeons, players, joinData.lockmap); - if (dungeons.empty()) - joinData.result = grp ? LFG_JOIN_PARTY_NOT_MEET_REQS : LFG_JOIN_NOT_MEET_REQS; + // if we have lockmap then there are no compatible dungeons + GetCompatibleDungeons(dungeons, players, joinData.lockmap); + if (dungeons.empty()) + joinData.result = grp ? LFG_JOIN_PARTY_NOT_MEET_REQS : LFG_JOIN_NOT_MEET_REQS; + } } // Can't join. Send result -- cgit v1.2.3