From da5c7bb527a456a359fca3afbce59a80923fc9b9 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 16 Aug 2020 17:56:10 -0400 Subject: [PATCH] v0.8.2a: actually fixed guidebook page crashes --- .../shatteredpixeldungeon/levels/RegularLevel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 23b3a20b8..4386eab59 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -411,7 +411,7 @@ public abstract class RegularLevel extends Level { //chance to find a page scales with pages missing and depth float dropChance = (missingPages.size() + Dungeon.depth - 1) / (float)(allPages.size() - 2); - if (Random.Float() < dropChance){ + if (!missingPages.isEmpty() && Random.Float() < dropChance){ GuidePage p = new GuidePage(); p.page(missingPages.get(0)); int cell = randomDropCell();