v2.4.0: adjusted bridge rooms to not place items/chars in gaps
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user