From 1e8b2c8dd8e819472d87dd32aa8b40ddc5a58b82 Mon Sep 17 00:00:00 2001 From: Kevin-771 <70790256+Kevin-771@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:54:32 -0400 Subject: [PATCH] Removed ability to change TreeTent goals Fixed bug where when solving a TreeTent puzzle, we were able to change the goals of the puzzle --- src/main/java/edu/rpi/legup/model/gameboard/GridBoard.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/rpi/legup/model/gameboard/GridBoard.java b/src/main/java/edu/rpi/legup/model/gameboard/GridBoard.java index 3e94c57ad..404ceafc7 100644 --- a/src/main/java/edu/rpi/legup/model/gameboard/GridBoard.java +++ b/src/main/java/edu/rpi/legup/model/gameboard/GridBoard.java @@ -68,14 +68,14 @@ public void setCell(int x, int y, GridCell cell) { } public void setCell(int x, int y, Element e, MouseEvent m) { - if (this instanceof TreeTentBoard && ((y == dimension.height && 0 <= x && x < dimension.width) || (x == dimension.width && 0 <= y && y < dimension.height))) { + if (this instanceof TreeTentBoard && ((0 <= x && x < dimension.width) && (0 <= y && y < dimension.height))) { TreeTentBoard treeTentBoard = ((TreeTentBoard) this); TreeTentClue clue = treeTentBoard.getClue(x, y); - if (y == dimension.height && clue.getData() < dimension.width) { + if (clue.getData() < dimension.width) { clue.setData(clue.getData() + 1); } else { - if (x == dimension.width && clue.getData() < dimension.height) { + if (clue.getData() < dimension.height) { clue.setData(clue.getData() + 1); } else {