diff options
author | Spp <none@none> | 2010-12-28 01:21:05 +0100 |
---|---|---|
committer | Spp <none@none> | 2010-12-28 01:21:05 +0100 |
commit | 9b73cb1694f5e2c968cf0a09b7a59984740e13e5 (patch) | |
tree | 45bd214128763ab25864e49b0f193ac46f5e16ab /src | |
parent | 88fe1da9eb7f27a4fc6a950864efdc337b3e4cb9 (diff) |
Core/Dungeon Finder: Fix crash in Update after DF system gone inconsistent
Note: Reason that makes DF go inconsistent not fixed, as it's not identified
Closes issue 5293
Thanks to cyberbrest for open my eyes and make me spot the problem
--HG--
branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/DungeonFinding/LFGMgr.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 48222d99944..426a138e4b9 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -253,13 +253,17 @@ void LFGMgr::Update(uint32 diff) // Check if a proposal can be formed with the new groups being added for (LfgGuidListMap::iterator it = m_newToQueue.begin(); it != m_newToQueue.end(); ++it) { + uint8 queueId = it->first; LfgGuidList& newToQueue = it->second; - LfgGuidList& currentQueue = m_currentQueue[it->first]; + LfgGuidList& currentQueue = m_currentQueue[queueId]; LfgGuidList firstNew; while (!newToQueue.empty()) { - sLog->outDebug("LFGMgr::Update: QueueId %u: checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", it->first, newToQueue.front(), uint32(newToQueue.size()), uint32(currentQueue.size())); - firstNew.push_back(newToQueue.front()); + uint64 frontguid = newToQueue.front(); + sLog->outDebug("LFGMgr::Update: QueueId %u: checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", queueId, frontguid, uint32(newToQueue.size()), uint32(currentQueue.size())); + firstNew.push_back(frontguid); + newToQueue.pop_front(); + LfgGuidList temporalList = currentQueue; if (LfgProposal* pProposal = FindNewGroups(firstNew, temporalList)) // Group found! { @@ -295,10 +299,7 @@ void LFGMgr::Update(uint32 diff) UpdateProposal(m_lfgProposalId, guid, true); } else - { - currentQueue.push_back(newToQueue.front());// Group not found, add this group to the queue. - newToQueue.pop_front(); - } + currentQueue.push_back(frontguid); // Lfg group not found, add this group to the queue. firstNew.clear(); } } |