v2.4.0: adjusted bridge rooms to not place items/chars in gaps

This commit is contained in:
Evan Debenham
2024-04-22 15:56:40 -04:00
parent da5cb1ceb5
commit 28628a31be
2 changed files with 20 additions and 0 deletions

View File

@@ -51,6 +51,16 @@ public abstract class BridgeRoom extends StandardRoom {
return l.map[cell] != spaceTile();
}
@Override
public boolean canPlaceItem(Point p, Level l) {
return super.canPlaceItem(p, l) && !spaceRect.inside(p);
}
@Override
public boolean canPlaceCharacter(Point p, Level l) {
return super.canPlaceItem(p, l) && !spaceRect.inside(p);
}
//keep these so that subclasses can use them in their methods
protected Rect spaceRect;
protected Rect bridgeRect;

View File

@@ -59,6 +59,16 @@ public class CavesFissureRoom extends StandardRoom {
}
}
@Override
public boolean canPlaceItem(Point p, Level l) {
return super.canPlaceItem(p, l) && l.map[l.pointToCell(p)] != Terrain.EMPTY_SP;
}
@Override
public boolean canPlaceCharacter(Point p, Level l) {
return super.canPlaceItem(p, l) && l.map[l.pointToCell(p)] != Terrain.EMPTY_SP;
}
@Override
public void paint(Level level) {