aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mines.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mines.c b/mines.c
index 711fc50..d40bb9f 100644
--- a/mines.c
+++ b/mines.c
@@ -2701,7 +2701,9 @@ static game_state *execute_move(const game_state *from, const char *move)
while (*move) {
if (move[0] == 'F' &&
sscanf(move+1, "%d,%d", &cx, &cy) == 2 &&
- cx >= 0 && cx < from->w && cy >= 0 && cy < from->h) {
+ cx >= 0 && cx < from->w && cy >= 0 && cy < from->h &&
+ (ret->grid[cy * from->w + cx] == -1 ||
+ ret->grid[cy * from->w + cx] == -2)) {
ret->grid[cy * from->w + cx] ^= (-2 ^ -1);
} else if (move[0] == 'O' &&
sscanf(move+1, "%d,%d", &cx, &cy) == 2 &&