From 548b29ea225676e544777e0d9b908c1f255fd613 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Fri, 11 Mar 2022 18:43:20 +0300 Subject: [PATCH] Block opening marked cells --- Field.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Field.cs b/Field.cs index 5d10daa..b331fc0 100644 --- a/Field.cs +++ b/Field.cs @@ -90,10 +90,10 @@ { if (y < 0 || y >= height || x < 0 || x >= width) throw new Exception("Coordinates out of the field!"); - if (cells[y * width + x].IsMine) - return true; if (cells[y * width + x].IsMarked) return false; + if (cells[y * width + x].IsMine) + return true; if (!opened.Contains(cells[y * width + x])) { opened.Add(cells[y * width + x]);