v0.8.2a: actually fixed guidebook page crashes

This commit is contained in:
Evan Debenham 2020-08-16 17:56:10 -04:00
parent 1a5051f701
commit da5c7bb527

View File

@ -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();