From ccb1dfe02ebc2132f62c9b29b014f0b895db7bc7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 2 Nov 2016 21:18:12 -0400 Subject: [PATCH] v0.4.3b: fixed a hang in levelgen --- .../shatteredpixeldungeon/levels/RegularLevel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index 46d173051..d5cab2c94 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -283,12 +283,14 @@ public abstract class RegularLevel extends Level { } } } - + while (count < 6) { - Room r = randomRoom( Type.TUNNEL, 1 ); + Room r = randomRoom( Type.TUNNEL, 20 ); if (r != null) { r.type = Type.STANDARD; count++; + } else { + return false; } }