v0.8.0b: various fixes for levelgen freezing:
- Wandmaker rarely not having a place to go in a 3*3 room with 4 doors - Nowhere to place the hero if they fall from a chasm into a boss floor
This commit is contained in:
parent
55340817e8
commit
9912c5e1ee
|
@ -278,7 +278,7 @@ public class Wandmaker extends NPC {
|
||||||
|
|
||||||
Wandmaker npc = new Wandmaker();
|
Wandmaker npc = new Wandmaker();
|
||||||
boolean validPos;
|
boolean validPos;
|
||||||
//Do not spawn wandmaker on the entrance, or next to a door.
|
//Do not spawn wandmaker on the entrance, or in front of a door.
|
||||||
do {
|
do {
|
||||||
validPos = true;
|
validPos = true;
|
||||||
npc.pos = level.pointToCell(room.random());
|
npc.pos = level.pointToCell(room.random());
|
||||||
|
@ -286,7 +286,7 @@ public class Wandmaker extends NPC {
|
||||||
validPos = false;
|
validPos = false;
|
||||||
}
|
}
|
||||||
for (Point door : room.connected.values()){
|
for (Point door : room.connected.values()){
|
||||||
if (level.adjacent( npc.pos, level.pointToCell( door ) )){
|
if (level.trueDistance( npc.pos, level.pointToCell( door ) ) <= 1){
|
||||||
validPos = false;
|
validPos = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -863,8 +863,7 @@ public abstract class Level implements Bundlable {
|
||||||
do {
|
do {
|
||||||
result = randomRespawnCell( null );
|
result = randomRespawnCell( null );
|
||||||
} while (traps.get(result) != null
|
} while (traps.get(result) != null
|
||||||
|| findMob(result) != null
|
|| findMob(result) != null);
|
||||||
|| heaps.get(result) != null);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user