- commit
- a8f733ca6c96d40c9b74fb348958800ac16b396e
- parent
- 155153aa15399321f5d788dd7d89fbbf57ad173b
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2019-10-26 18:27
don't allow to overwrite enemy cells
Diffstat
| M | src/index.js | 2 | +- |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js
@@ -60,7 +60,7 @@ on('mousedown', '.board-cell', function(state, event) {
60 60 const currentPlayer = state.game.currentPlayer === constants.EMPTY ? constants.GAIA : state.game.currentPlayer;
61 61 if (state.game.board[y][x] === currentPlayer) {
62 62 state.game.board[y][x] = constants.EMPTY;
63 -1 } else {
-1 63 } else if (state.game.board[y][x] === constants.EMPTY) {
64 64 state.game.board[y][x] = currentPlayer;
65 65 }
66 66 });