v0.4.3a: fixed an infinite loop in levelgen caused by the wandmaker
This commit is contained in:
parent
e065d68f71
commit
0af0fec634
|
@ -262,7 +262,9 @@ public class Wandmaker extends NPC {
|
|||
Wandmaker npc = new Wandmaker();
|
||||
do {
|
||||
npc.pos = level.pointToCell(room.random());
|
||||
} while (level.map[npc.pos] == Terrain.ENTRANCE || level.map[npc.pos] == Terrain.SIGN);
|
||||
//Wandmaker must never spawn in the center.
|
||||
//If he does, and the room is 3x3, there is no room for the stairs.
|
||||
} while (npc.pos == level.pointToCell(room.center()));
|
||||
level.mobs.add( npc );
|
||||
|
||||
spawned = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user