Skip to content

Commit

Permalink
Merge pull request #28436 from omkelderman/fix-auto-pick-map-on-zero-…
Browse files Browse the repository at this point in the history
…ban-round

Fix auto picking maps on zero ban rounds
  • Loading branch information
peppy authored Jun 10, 2024
2 parents be48377 + 642095b commit a8a2e54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ protected override void LoadComplete()

private void beatmapChanged(ValueChangedEvent<TournamentBeatmap?> beatmap)
{
if (CurrentMatch.Value == null || CurrentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) < 2)
if (CurrentMatch.Value?.Round.Value == null)
return;

int totalBansRequired = CurrentMatch.Value.Round.Value.BanCount.Value * 2;

if (CurrentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) < totalBansRequired)
return;

// if bans have already been placed, beatmap changes result in a selection being made automatically
Expand Down

0 comments on commit a8a2e54

Please sign in to comment.