v0.6.4a: fixed unique items in bags being removed by ankh revive
This commit is contained in:
parent
01b575c005
commit
f850f6d521
|
@ -206,7 +206,7 @@ public class Belongings implements Iterable<Item> {
|
|||
item.detachAll(backpack);
|
||||
//you keep the bag itself, not its contents.
|
||||
if (item instanceof Bag){
|
||||
((Bag)item).clear();
|
||||
((Bag)item).resurrect();
|
||||
}
|
||||
item.collect();
|
||||
} else if (!item.isEquipped( owner )) {
|
||||
|
|
|
@ -114,6 +114,12 @@ public class Bag extends Item implements Iterable<Item> {
|
|||
items.clear();
|
||||
}
|
||||
|
||||
public void resurrect() {
|
||||
for (Item item : items.toArray(new Item[0])){
|
||||
if (!item.unique) items.remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
private static final String ITEMS = "inventory";
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user