v0.2.3e: fixed a bug with sewer boss level gen.. hopefully for real this time.
This commit is contained in:
parent
02693eef4d
commit
97f6b2f67c
|
@ -79,11 +79,11 @@ public class SewerBossLevel extends RegularLevel {
|
||||||
//now find the rest of the rooms for this boss mini-maze
|
//now find the rest of the rooms for this boss mini-maze
|
||||||
Room curRoom = null;
|
Room curRoom = null;
|
||||||
Room lastRoom = roomEntrance;
|
Room lastRoom = roomEntrance;
|
||||||
//we make 4 rooms, last iteration is tieing the final toom to the start
|
//we make 4 rooms, last iteration is tieing the final room to the start
|
||||||
for(int i = 0; i <= 4; i++){
|
for(int i = 0; i <= 4; i++){
|
||||||
retry = 0;
|
retry = 0;
|
||||||
//find a suitable room the first four times
|
//find a suitable room the first four times
|
||||||
//suitable room should be empty, have a distance of 2 from the current room, and not be adjacent to the entrance.
|
//suitable room should be empty, have a distance of 2 from the current room, and not touch the entrance.
|
||||||
if (i < 4) {
|
if (i < 4) {
|
||||||
do {
|
do {
|
||||||
if (retry++ > 20) {
|
if (retry++ > 20) {
|
||||||
|
@ -92,7 +92,7 @@ public class SewerBossLevel extends RegularLevel {
|
||||||
curRoom = Random.element(rooms);
|
curRoom = Random.element(rooms);
|
||||||
Graph.buildDistanceMap(rooms, curRoom);
|
Graph.buildDistanceMap(rooms, curRoom);
|
||||||
distance = lastRoom.distance();
|
distance = lastRoom.distance();
|
||||||
} while (curRoom.type != Type.NULL || distance != 2 || curRoom.neigbours.contains(roomEntrance));
|
} while (curRoom.type != Type.NULL || distance != 2 || !curRoom.intersect(roomEntrance).isEmpty());
|
||||||
|
|
||||||
curRoom.type = Type.STANDARD;
|
curRoom.type = Type.STANDARD;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user