v0.4.0: improved some interactions with full inventories
This commit is contained in:
parent
edbb426764
commit
65b0a40865
|
@ -38,7 +38,6 @@ public abstract class KindofMisc extends EquipableItem {
|
|||
|
||||
final KindofMisc m1 = hero.belongings.misc1;
|
||||
final KindofMisc m2 = hero.belongings.misc2;
|
||||
final KindofMisc toEquip = this;
|
||||
|
||||
GameScene.show(
|
||||
new WndOptions(Messages.get(KindofMisc.class, "unequip_title"),
|
||||
|
@ -50,8 +49,11 @@ public abstract class KindofMisc extends EquipableItem {
|
|||
protected void onSelect(int index) {
|
||||
|
||||
KindofMisc equipped = (index == 0 ? m1 : m2);
|
||||
detach( hero.belongings.backpack );
|
||||
if (equipped.doUnequip(hero, true, false)) {
|
||||
execute(hero, AC_EQUIP);
|
||||
} else {
|
||||
collect( hero.belongings.backpack );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user