v0.2.2: fixed a couple bugs with keys and stackable items
This commit is contained in:
parent
0ce2754de9
commit
cd124d2320
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user