From a8dc81984f0ceb6041f1859676d4a2ae8cee8b8f Mon Sep 17 00:00:00 2001 From: Urban Modig Date: Sat, 6 Sep 2025 20:30:12 +0200 Subject: [PATCH] Fixed so that ghosts dont accidently go back in house --- src/main/java/se/urmo/game/map/GameMap.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/se/urmo/game/map/GameMap.java b/src/main/java/se/urmo/game/map/GameMap.java index 11277c0..1d28f08 100644 --- a/src/main/java/se/urmo/game/map/GameMap.java +++ b/src/main/java/se/urmo/game/map/GameMap.java @@ -3,6 +3,7 @@ package se.urmo.game.map; import lombok.extern.slf4j.Slf4j; import se.urmo.game.entities.BaseAnimated; import se.urmo.game.entities.ghost.Ghost; +import se.urmo.game.entities.ghost.mode.GhostMode; import se.urmo.game.util.Direction; import java.awt.Graphics; @@ -136,8 +137,8 @@ public class GameMap { // For Ghost entities, check if this is a ghost-passable tile // You might want to refine this logic based on specific tile types or ghost states - // Example: Allow ghosts to pass through ghost house door - if (mapTile.getTileType() == TileType.DOOR) { + // Example: Allow ghosts to pass through ghost house door IF in house mode + if (mapTile.getTileType() == TileType.DOOR && ((Ghost) entity).currentMode() == GhostMode.HOUSE) { return false; // Not solid for ghosts } }