From c4d577bfb2881673326df8ccb2e86e9820f45ce2 Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Thu, 8 Feb 2024 00:38:15 +0100 Subject: [PATCH] fixed findCellByString funcition in Map --- src/main/java/pacmanGame/Map.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/pacmanGame/Map.java b/src/main/java/pacmanGame/Map.java index b9d45d4..b53711e 100644 --- a/src/main/java/pacmanGame/Map.java +++ b/src/main/java/pacmanGame/Map.java @@ -81,12 +81,12 @@ public class Map { public Cell findCellByString(String target) { for (int x = 0; x < size.x; x++) { for (int y = 0; y < size.y; y++) { - if (cells[x][y].type == target) { + if (cells[x][y].type.equals(target)) { return cells[x][y]; } } } - + System.out.println("couldnt find cell " + target); return null; } }