summaryrefslogtreecommitdiff
path: root/Games
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-14 05:53:13 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-14 05:53:13 +0200
commit0e30f4e4120240b43b24fe728b571b2c00da46a1 (patch)
tree90709da93cee9b5ee8b2e9d3eda2f83027ad5c49 /Games
parenta3e8fc3d9c57651a25d42b9ccd2b6dc7384f7596 (diff)
downloadserenity-0e30f4e4120240b43b24fe728b571b2c00da46a1.zip
Minesweeper: Flood fill should include the first numbered found.
Diffstat (limited to 'Games')
-rw-r--r--Games/Minesweeper/Field.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Games/Minesweeper/Field.cpp b/Games/Minesweeper/Field.cpp
index 25deb47b03..00161aa8c1 100644
--- a/Games/Minesweeper/Field.cpp
+++ b/Games/Minesweeper/Field.cpp
@@ -157,6 +157,8 @@ void Field::flood_fill(Square& square)
for_each_neighbor_of(square, [this] (auto& neighbor) {
if (!neighbor.is_swept && !neighbor.has_mine && neighbor.number == 0)
flood_fill(neighbor);
+ if (!neighbor.has_mine && neighbor.number)
+ on_square_clicked(neighbor);
});
}