mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 23:56:06 +00:00
Minesweeper: Flood fill should include the first numbered found.
This commit is contained in:
parent
a3e8fc3d9c
commit
0e30f4e412
Notes:
sideshowbarker
2024-07-19 14:43:14 +09:00
Author: https://github.com/awesomekling
Commit: 0e30f4e412
1 changed files with 2 additions and 0 deletions
|
@ -157,6 +157,8 @@ void Field::flood_fill(Square& square)
|
||||||
for_each_neighbor_of(square, [this] (auto& neighbor) {
|
for_each_neighbor_of(square, [this] (auto& neighbor) {
|
||||||
if (!neighbor.is_swept && !neighbor.has_mine && neighbor.number == 0)
|
if (!neighbor.is_swept && !neighbor.has_mine && neighbor.number == 0)
|
||||||
flood_fill(neighbor);
|
flood_fill(neighbor);
|
||||||
|
if (!neighbor.has_mine && neighbor.number)
|
||||||
|
on_square_clicked(neighbor);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue