Skip to content

Commit

Permalink
Removed ability to change TreeTent goals
Browse files Browse the repository at this point in the history
Fixed bug where when solving a TreeTent puzzle, we were able to change the goals of the puzzle
  • Loading branch information
Kevin-771 committed Oct 6, 2023
1 parent 12eb296 commit 1e8b2c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/edu/rpi/legup/model/gameboard/GridBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1e8b2c8

Please sign in to comment.