mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/LFG: Handle vote kick as failed if there cannot be 3 votes agreeing
i.e: 4 players, vote kick starts, 1 rejects, vote is considered as failed.
This commit is contained in:
@@ -1276,20 +1276,25 @@ void LFGMgr::UpdateBoot(ObjectGuid guid, bool accept)
|
||||
|
||||
boot.votes[guid] = LfgAnswer(accept);
|
||||
|
||||
uint8 votesNum = 0;
|
||||
uint8 agreeNum = 0;
|
||||
uint8 denyNum = 0;
|
||||
for (LfgAnswerContainer::const_iterator itVotes = boot.votes.begin(); itVotes != boot.votes.end(); ++itVotes)
|
||||
{
|
||||
if (itVotes->second != LFG_ANSWER_PENDING)
|
||||
switch (itVotes->second)
|
||||
{
|
||||
++votesNum;
|
||||
if (itVotes->second == LFG_ANSWER_AGREE)
|
||||
case LFG_ANSWER_PENDING:
|
||||
break;
|
||||
case LFG_ANSWER_AGREE:
|
||||
++agreeNum;
|
||||
break;
|
||||
case LFG_ANSWER_DENY:
|
||||
++denyNum;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if we don't have enough votes (agree or deny) do nothing
|
||||
if (agreeNum < LFG_GROUP_KICK_VOTES_NEEDED && (votesNum - agreeNum) < LFG_GROUP_KICK_VOTES_NEEDED)
|
||||
if (agreeNum < LFG_GROUP_KICK_VOTES_NEEDED && (boot.votes.size() - denyNum) >= LFG_GROUP_KICK_VOTES_NEEDED)
|
||||
return;
|
||||
|
||||
// Send update info to all players
|
||||
|
||||
Reference in New Issue
Block a user