v0.6.1: fixed rare problematic enemy and npc placement
This commit is contained in:
+6
-1
@@ -276,7 +276,12 @@ public abstract class RegularLevel extends Level {
|
||||
continue;
|
||||
}
|
||||
|
||||
cell = pointToCell(room.random());
|
||||
//if we can avoid it, don't place along the perimiter
|
||||
if (room.width() >= 6 && room.height() >= 6) {
|
||||
cell = pointToCell(room.random(2));
|
||||
} else {
|
||||
cell = pointToCell(room.random(1));
|
||||
}
|
||||
if (!Dungeon.visible[cell]
|
||||
&& Actor.findChar( cell ) == null
|
||||
&& Level.passable[cell]
|
||||
|
||||
+2
-2
@@ -33,12 +33,12 @@ public class PlatformRoom extends StandardRoom {
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
return Math.max(super.minWidth(), 5);
|
||||
return Math.max(super.minWidth(), 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minHeight() {
|
||||
return Math.max(super.minHeight(), 5);
|
||||
return Math.max(super.minHeight(), 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user