mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 09:14:09 +00:00
bugfix
This commit is contained in:
@@ -143,13 +143,15 @@ export class WinCheckExecution implements Execution {
|
|||||||
(this.mg.config().gameConfig().maxTimerValue !== undefined &&
|
(this.mg.config().gameConfig().maxTimerValue !== undefined &&
|
||||||
timeElapsed - this.mg.config().gameConfig().maxTimerValue! * 60 >= 0)
|
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
|
const scores = this.mg.config().gameConfig().competitiveScoring
|
||||||
? this.computeScores(teamToTiles, numTilesWithoutFallout)
|
? this.computeScores(teamToTiles, numTilesWithoutFallout)
|
||||||
: undefined;
|
: undefined;
|
||||||
this.mg.setWinner(max[0], this.mg.stats().stats(), scores);
|
this.mg.setWinner(winner[0], this.mg.stats().stats(), scores);
|
||||||
console.log(`${max[0]} has won the game`);
|
console.log(`${winner[0]} has won the game`);
|
||||||
this.active = false;
|
this.active = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user