diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java index 604e4a0cd..78520bf12 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java @@ -124,7 +124,7 @@ public class Belongings implements Iterable { for (Item item : backpack) { if (item instanceof IronKey && ((IronKey)item).depth == Dungeon.depth) { - IronKey.curDepthQuantity++; + IronKey.curDepthQuantity += item.quantity(); } } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Item.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Item.java index a4f910295..21af82be5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Item.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Item.java @@ -211,7 +211,14 @@ public class Item implements Bundlable { updateQuickslot(); try { + + //pssh, who needs copy constructors? Item detached = getClass().newInstance(); + Bundle copy = new Bundle(); + this.storeInBundle(copy); + detached.restoreFromBundle(copy); + detached.quantity(1); + detached.onDetach( ); return detached; } catch (Exception e) {