v0.2.2: fixed a couple bugs with keys and stackable items

This commit is contained in:
Evan Debenham 2014-11-01 17:14:49 -04:00
parent 0ce2754de9
commit cd124d2320
2 changed files with 8 additions and 1 deletions

View File

@ -124,7 +124,7 @@ public class Belongings implements Iterable<Item> {
for (Item item : backpack) { for (Item item : backpack) {
if (item instanceof IronKey && ((IronKey)item).depth == Dungeon.depth) { if (item instanceof IronKey && ((IronKey)item).depth == Dungeon.depth) {
IronKey.curDepthQuantity++; IronKey.curDepthQuantity += item.quantity();
} }
} }
} }

View File

@ -211,7 +211,14 @@ public class Item implements Bundlable {
updateQuickslot(); updateQuickslot();
try { try {
//pssh, who needs copy constructors?
Item detached = getClass().newInstance(); Item detached = getClass().newInstance();
Bundle copy = new Bundle();
this.storeInBundle(copy);
detached.restoreFromBundle(copy);
detached.quantity(1);
detached.onDetach( ); detached.onDetach( );
return detached; return detached;
} catch (Exception e) { } catch (Exception e) {