Merge pull request #1373 from PieterHeemeryck/fix/minesweeper/flagLeftClick

This commit is contained in:
Hugo Bernier 2020-07-06 12:22:56 -04:00 committed by GitHub
commit efc03de60f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -246,7 +246,7 @@ export default class Minesweeper extends React.Component<IMinesweeperProps, IMin
return;
}
if(tile.fieldType === FieldType.Number || tile.fieldType === FieldType.Empty){
if(tile.fieldType === FieldType.Number || tile.fieldType === FieldType.Empty || tile.fieldType === FieldType.Flag){
return;
}
@ -256,10 +256,6 @@ export default class Minesweeper extends React.Component<IMinesweeperProps, IMin
return;
}
if(tile.fieldType === FieldType.Flag){
nrMinesLeft++;
}
let closeMines = this.getSurroundingMines(grid, coord);
if(closeMines > 0){
tile.closeMines = closeMines;