From 80a5cda77f360632baef0f99f317bc186566214c Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 22 Dec 2010 13:20:18 +0100 Subject: [PATCH] Core/Dungeon Finder: Fix wrong join result when joining with random dungeons and there are disabled dungeons. If no disabled dungeons players also got the same problem if they have done an heroic dungeon today Thanks to j4r0d for the help spotting the error and testing --HG-- branch : trunk --- src/server/game/DungeonFinding/LFGMgr.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 4cbb16af7a..c7fe7249b2 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -615,20 +615,16 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon // if we have lockmap then there are no compatible dungeons GetCompatibleDungeons(dungeons, players, joinData.lockmap); - if (!joinData.lockmap.empty()) - { - joinData.result = LFG_JOIN_PARTY_NOT_MEET_REQS; - sLog.outDebug("LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: LFG_JOIN_PARTY_NOT_MEET_REQS", guid, uint8(players.size())); - plr->GetSession()->SendLfgJoinResult(joinData); - return; - } - joinData.lockmap.clear(); + if (dungeons.empty()) + joinData.result = grp ? LFG_JOIN_PARTY_NOT_MEET_REQS : LFG_JOIN_NOT_MEET_REQS; } // Can't join. Send result if (joinData.result != LFG_JOIN_OK) { sLog.outDebug("LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); + if (!dungeons.empty()) // Only should show lockmap when have no dungeons available + joinData.lockmap.clear(); plr->GetSession()->SendLfgJoinResult(joinData); return; } @@ -1215,11 +1211,11 @@ LfgAnswer LFGMgr::GetCompatibles(std::string key) @param[in,out] dungeons Dungeons to check restrictions @param[in] players Set of players to check their dungeon restrictions - @param[in] returnLockMap Determines when to return a function value (Default true) - @param[out] Map of players Lock status info of given dungeons + @param[out] lockMap Map of players Lock status info of given dungeons (Empty if dungeons is not empty) */ void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const PlayerSet& players, LfgLockPartyMap& lockMap) { + lockMap.clear(); for (PlayerSet::const_iterator it = players.begin(); it != players.end() && dungeons.size(); ++it) { uint64 guid = (*it)->GetGUID(); @@ -1235,6 +1231,8 @@ void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const PlayerSet& pla } } } + if (dungeons.size()) + lockMap.clear(); } /**