v0.8.2a: actually fixed guidebook page crashes
This commit is contained in:
parent
1a5051f701
commit
da5c7bb527
|
@ -411,7 +411,7 @@ public abstract class RegularLevel extends Level {
|
||||||
|
|
||||||
//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 - 1) / (float)(allPages.size() - 2);
|
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();
|
GuidePage p = new GuidePage();
|
||||||
p.page(missingPages.get(0));
|
p.page(missingPages.get(0));
|
||||||
int cell = randomDropCell();
|
int cell = randomDropCell();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user