v0.8.2a: fixed a crash bug introduced by guidebook changes

This commit is contained in:
Evan Debenham 2020-08-13 23:23:22 -04:00
parent e51025de0c
commit a78df087f6

View File

@ -403,7 +403,7 @@ public abstract class RegularLevel extends Level {
missingPages.remove(Document.GUIDE_SEARCH_PAGE); missingPages.remove(Document.GUIDE_SEARCH_PAGE);
//chance to find a page scales with pages missing and depth //chance to find a page scales with pages missing and depth
float dropChance = (missingPages.size() + Dungeon.depth) / (float)(allPages.size() - 2); float dropChance = (missingPages.size() + Dungeon.depth - 1) / (float)(allPages.size() - 2);
if (Random.Float() < dropChance){ if (Random.Float() < dropChance){
GuidePage p = new GuidePage(); GuidePage p = new GuidePage();
p.page(missingPages.get(0)); p.page(missingPages.get(0));