fix: when left-click the flagged block, will not trigger explosion

This commit is contained in:
kiameow
2024-07-29 10:27:49 +08:00
parent 294cdb72af
commit 6b5fd1de17

View File

@@ -133,7 +133,15 @@ export class GamePlay {
this.generateMines(this.board, block);
this.state.value.mineGenerated = true;
}
if (block.revealed)
return;
if (block.flagged) {
block.flagged = !block.flagged;
return;
}
block.revealed = true;
if (block.mine) {
this.onGameOver('lost');