Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/core/execution/WinCheckExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ export class WinCheckExecution implements Execution {

const max = sorted[0];
const timeElapsed = this.mg.elapsedGameSeconds();
const numTilesWithoutFallout =
this.mg.numLandTiles() - this.mg.numTilesWithFallout();
const numTilesWithoutFallout = Math.max(
1,
this.mg.numLandTiles() - this.mg.numTilesWithFallout(),
);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
if (
(max.numTilesOwned() / numTilesWithoutFallout) * 100 >
this.mg.config().percentageTilesOwnedToWin() ||
Expand Down Expand Up @@ -162,8 +164,10 @@ export class WinCheckExecution implements Execution {
}
const max = sorted[0];
const timeElapsed = this.mg.elapsedGameSeconds();
const numTilesWithoutFallout =
this.mg.numLandTiles() - this.mg.numTilesWithFallout();
const numTilesWithoutFallout = Math.max(
1,
this.mg.numLandTiles() - this.mg.numTilesWithFallout(),
);
const percentage = (max[1] / numTilesWithoutFallout) * 100;
if (
percentage > this.mg.config().percentageTilesOwnedToWin() ||
Expand Down
Loading