From 16fedbbd8458f0c934d56487d230b21f738b3d7d Mon Sep 17 00:00:00 2001 From: Ryan Barlow Date: Sun, 1 Mar 2026 14:36:57 +0000 Subject: [PATCH] bugfix --- src/core/execution/WinCheckExecution.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/execution/WinCheckExecution.ts b/src/core/execution/WinCheckExecution.ts index c55622aba..b06d205af 100644 --- a/src/core/execution/WinCheckExecution.ts +++ b/src/core/execution/WinCheckExecution.ts @@ -143,13 +143,15 @@ export class WinCheckExecution implements Execution { (this.mg.config().gameConfig().maxTimerValue !== undefined && timeElapsed - this.mg.config().gameConfig().maxTimerValue! * 60 >= 0) ) { - if (max[0] === ColoredTeams.Bot) return; + // Pick the top non-Bot team as the winner. + const winner = sorted.find((t) => t[0] !== ColoredTeams.Bot); + if (winner === undefined) return; const scores = this.mg.config().gameConfig().competitiveScoring ? this.computeScores(teamToTiles, numTilesWithoutFallout) : undefined; - this.mg.setWinner(max[0], this.mg.stats().stats(), scores); - console.log(`${max[0]} has won the game`); + this.mg.setWinner(winner[0], this.mg.stats().stats(), scores); + console.log(`${winner[0]} has won the game`); this.active = false; } }