mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:30:43 +00:00
bugfix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user