Fixed issue where pick order was following ban order structure

This commit is contained in:
Rodrigo Pina 2023-11-29 11:31:15 +00:00
parent 60d6c0fe53
commit a33a4c4d1d
1 changed files with 5 additions and 1 deletions

View File

@ -155,10 +155,14 @@ private void setNextMode()
var previousBan = CurrentMatch.Value.PicksBans.LastOrDefault()?.Team ?? roll_winner;
var nextColour = (CurrentMatch.Value.PicksBans.Count() >= 2 ? CurrentMatch.Value.PicksBans[^2]?.Team : previousBan) == TeamColour.Red ? TeamColour.Blue : TeamColour.Red;
var nextColour = previousBan == TeamColour.Red ? TeamColour.Blue : TeamColour.Red;
bool hasAllBans = CurrentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) >= totalBansRequired;
if (!hasAllBans)
// If it's the third ban or later, we need to check if it's the team's first or second ban in a row
nextColour = (CurrentMatch.Value.PicksBans.Count() >= 2 ? CurrentMatch.Value.PicksBans[^2]?.Team : previousBan) == TeamColour.Red ? TeamColour.Blue : TeamColour.Red;
if (hasAllBans && pickType == ChoiceType.Ban)
{
// When switching from bans to picks, we don't rotate the team colour.