Core/LFG: Handle vote kick as failed if there cannot be 3 votes agreeing
Port From (https://github.com/TrinityCore/TrinityCore/commit/d1bea3e8b39c53b5427bfef9806e0282624e891f)
This commit is contained in:
@@ -1219,20 +1219,25 @@ namespace Game.DungeonFinding
|
|||||||
|
|
||||||
boot.votes[guid] = (LfgAnswer)Convert.ToInt32(accept);
|
boot.votes[guid] = (LfgAnswer)Convert.ToInt32(accept);
|
||||||
|
|
||||||
byte votesNum = 0;
|
|
||||||
byte agreeNum = 0;
|
byte agreeNum = 0;
|
||||||
foreach (var itVotes in boot.votes)
|
byte denyNum = 0;
|
||||||
|
foreach (var (_, answer) in boot.votes)
|
||||||
{
|
{
|
||||||
if (itVotes.Value != LfgAnswer.Pending)
|
switch (answer)
|
||||||
{
|
{
|
||||||
++votesNum;
|
case LfgAnswer.Pending:
|
||||||
if (itVotes.Value == LfgAnswer.Agree)
|
break;
|
||||||
|
case LfgAnswer.Agree:
|
||||||
++agreeNum;
|
++agreeNum;
|
||||||
|
break;
|
||||||
|
case LfgAnswer.Deny:
|
||||||
|
++denyNum;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we don't have enough votes (agree or deny) do nothing
|
// if we don't have enough votes (agree or deny) do nothing
|
||||||
if (agreeNum < SharedConst.LFGKickVotesNeeded && (votesNum - agreeNum) < SharedConst.LFGKickVotesNeeded)
|
if (agreeNum < SharedConst.LFGKickVotesNeeded && (boot.votes.Count - denyNum) >= SharedConst.LFGKickVotesNeeded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Send update info to all players
|
// Send update info to all players
|
||||||
|
|||||||
Reference in New Issue
Block a user