From 9177ae404c3ee98257375ae2a5f6e043cb192140 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:28:17 +0300 Subject: [PATCH] Fix counterpick all won modes getting banned --- app/features/tournament-bracket/core/PickBan.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/features/tournament-bracket/core/PickBan.ts b/app/features/tournament-bracket/core/PickBan.ts index 948da1b9d..0e6431758 100644 --- a/app/features/tournament-bracket/core/PickBan.ts +++ b/app/features/tournament-bracket/core/PickBan.ts @@ -197,9 +197,11 @@ function unavailableModes({ }): Set { if (!maps?.pickBan || maps.pickBan === "BAN_2") return new Set(); + // can't pick the same mode last won on const result = new Set( results .filter((result) => result.winnerTeamId === pickerTeamId) + .slice(-1) .map((result) => result.mode), );