v0.4.0: improved some interactions with full inventories
This commit is contained in:
committed by
Evan Debenham
parent
edbb426764
commit
65b0a40865
@@ -65,17 +65,19 @@ public class Bag extends Item implements Iterable<Item> {
|
||||
|
||||
@Override
|
||||
public boolean collect( Bag container ) {
|
||||
|
||||
for (Item item : container.items.toArray( new Item[0] )) {
|
||||
if (grab( item )) {
|
||||
item.detachAll( container );
|
||||
if (!item.collect( this ))
|
||||
item.collect( container );
|
||||
}
|
||||
}
|
||||
|
||||
if (super.collect( container )) {
|
||||
|
||||
owner = container.owner;
|
||||
|
||||
for (Item item : container.items.toArray( new Item[0] )) {
|
||||
if (grab( item )) {
|
||||
item.detachAll( container );
|
||||
item.collect( this );
|
||||
}
|
||||
}
|
||||
|
||||
Badges.validateAllBagsBought( this );
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user