From 0af0fec6349aecbf13850d60c05a7e289e28e67a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 20 Oct 2016 02:46:57 -0400 Subject: [PATCH] v0.4.3a: fixed an infinite loop in levelgen caused by the wandmaker --- .../shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java index 81685db8b..17ae8bae8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java @@ -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;