v0.7.2: added a safety check to new wealth logic

This commit is contained in:
Evan Debenham 2019-02-18 13:44:13 -05:00
parent 2dc3696a17
commit d23ad85596
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -141,7 +141,7 @@ public class Heap implements Bundlable {
if (type != Type.MIMIC) {
type = Type.HEAP;
ArrayList<Item> 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);