From 6fc162760dd668e427a22b267439b48c09ec1869 Mon Sep 17 00:00:00 2001 From: "tyler :3" Date: Fri, 17 May 2024 18:24:29 +0100 Subject: [PATCH] fix illegal flags --- src/main/java/com/shr4pnel/minesweeper/Controller.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/shr4pnel/minesweeper/Controller.java b/src/main/java/com/shr4pnel/minesweeper/Controller.java index f98e484..3f6b503 100644 --- a/src/main/java/com/shr4pnel/minesweeper/Controller.java +++ b/src/main/java/com/shr4pnel/minesweeper/Controller.java @@ -170,6 +170,9 @@ public class Controller { Button tileAsButton = (Button) tileClicked; ImageView tileGraphic = (ImageView) tileAsButton.getGraphic(); Image tileGraphicImage = tileGraphic.getImage(); + if (!tileGraphicImage.getUrl().contains("blank.png") && !tileGraphicImage.getUrl().contains("flagged.png")) { + return; + } boolean flagged = tileGraphicImage.getUrl().contains("flagged.png"); if (flagged) { bombCount++;