Dungeon Finder: Fix a possible crash in UpdateProposal
--HG-- branch : trunk
This commit is contained in:
@@ -1074,9 +1074,10 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint32 lowGuid, uint8 accept)
|
|||||||
LfgProposal *pProposal = itProposal->second;
|
LfgProposal *pProposal = itProposal->second;
|
||||||
|
|
||||||
// Check if proposal have the current player
|
// Check if proposal have the current player
|
||||||
LfgProposalPlayer *ppPlayer = pProposal->players[lowGuid];
|
LfgProposalPlayerMap::iterator itProposalPlayer = pProposal->players.find(lowGuid);
|
||||||
if (!ppPlayer)
|
if (itProposalPlayer == pProposal->players.end())
|
||||||
return;
|
return;
|
||||||
|
LfgProposalPlayer *ppPlayer = itProposalPlayer->second;
|
||||||
|
|
||||||
ppPlayer->accept = accept;
|
ppPlayer->accept = accept;
|
||||||
if (!accept)
|
if (!accept)
|
||||||
@@ -1094,10 +1095,13 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint32 lowGuid, uint8 accept)
|
|||||||
{
|
{
|
||||||
plr = sObjectMgr.GetPlayer(itPlayers->first);
|
plr = sObjectMgr.GetPlayer(itPlayers->first);
|
||||||
|
|
||||||
if (plr && itPlayers->first == pProposal->leaderLowGuid)
|
if (plr)
|
||||||
|
{
|
||||||
|
if (itPlayers->first == pProposal->leaderLowGuid)
|
||||||
players.push_front(plr);
|
players.push_front(plr);
|
||||||
else
|
else
|
||||||
players.push_back(plr);
|
players.push_back(plr);
|
||||||
|
}
|
||||||
|
|
||||||
if (itPlayers->second->accept < 1) // No answer (-1) or not accepted (0)
|
if (itPlayers->second->accept < 1) // No answer (-1) or not accepted (0)
|
||||||
allAnswered = false;
|
allAnswered = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user