From 67627f7a2f7d6c2aaf81fa421c3458175ed0853f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 29 Aug 2020 19:04:00 -0400 Subject: [PATCH] v0.8.2d: adjusted new bag logic to prevent a rare crash --- .../shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java index 2714dd87d..56818db7f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/Bag.java @@ -92,8 +92,8 @@ public class Bag extends Item implements Iterable { } public void grabItems(){ - if (this != Dungeon.hero.belongings.backpack) { - grabItems(Dungeon.hero.belongings.backpack); + if (owner != null && owner instanceof Hero && this != ((Hero) owner).belongings.backpack) { + grabItems(((Hero) owner).belongings.backpack); } }