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();
|
||||
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 {
|
||||
validPos = true;
|
||||
npc.pos = level.pointToCell(room.random());
|
||||
|
@ -286,7 +286,7 @@ public class Wandmaker extends NPC {
|
|||
validPos = false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -863,8 +863,7 @@ public abstract class Level implements Bundlable {
|
|||
do {
|
||||
result = randomRespawnCell( null );
|
||||
} while (traps.get(result) != null
|
||||
|| findMob(result) != null
|
||||
|| heaps.get(result) != null);
|
||||
|| findMob(result) != null);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user