浏览代码

Minesweeper: Flood fill should include the first numbered found.

Andreas Kling 6 年之前
父节点
当前提交
0e30f4e412
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Games/Minesweeper/Field.cpp

+ 2 - 0
Games/Minesweeper/Field.cpp

@@ -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);
     });
     });
 }
 }