Fixed so that ghosts dont accidently go back in house

This commit is contained in:
Urban Modig
2025-09-06 20:30:12 +02:00
parent 8865a196f8
commit a8dc81984f

View File

@ -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
}
}