From d23ad8559657b8b0bc33c8ec591fef5ae9b5d1db Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 18 Feb 2019 13:44:13 -0500 Subject: [PATCH] v0.7.2: added a safety check to new wealth logic --- .../shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java | 2 +- .../com/shatteredpixel/shatteredpixeldungeon/items/Heap.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index df5534e72..06fdce930 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -633,7 +633,7 @@ public abstract class Mob extends Char { if (properties.contains(Property.BOSS)) rolls = 15; else if (properties.contains(Property.MINIBOSS)) rolls = 5; ArrayList bonus = RingOfWealth.tryForBonusDrop(Dungeon.hero, rolls); - if (!bonus.isEmpty()) { + if (bonus != null && !bonus.isEmpty()) { for (Item b : bonus) Dungeon.level.drop(b, pos).sprite.drop(); if (RingOfWealth.latestDropWasRare){ new Flare(8, 48).color(0xAA00FF, true).show(sprite, 2f); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java index cdf44f906..e5c4eea2a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java @@ -141,7 +141,7 @@ public class Heap implements Bundlable { if (type != Type.MIMIC) { type = Type.HEAP; ArrayList bonus = RingOfWealth.tryForBonusDrop(hero, 1); - if (!bonus.isEmpty()) { + if (bonus != null && !bonus.isEmpty()) { items.addAll(0, bonus); if (RingOfWealth.latestDropWasRare){ new Flare(8, 48).color(0xAA00FF, true).show(sprite, 2f);