v0.9.4: improved unequipped item handling when invent is lost
This commit is contained in:
parent
4c1300aa21
commit
440694cd47
|
@ -127,12 +127,16 @@ public abstract class EquipableItem extends Item {
|
|||
hero.spend( time2equip( hero ) );
|
||||
}
|
||||
|
||||
//temporarily keep this item so it can be collected
|
||||
boolean wasKept = keptThoughLostInvent;
|
||||
keptThoughLostInvent = true;
|
||||
if (!collect || !collect( hero.belongings.backpack )) {
|
||||
onDetach();
|
||||
Dungeon.quickslot.clearItem(this);
|
||||
updateQuickslot();
|
||||
if (collect) Dungeon.level.drop( this, hero.pos );
|
||||
}
|
||||
keptThoughLostInvent = wasKept;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -130,9 +130,8 @@ public class WndResurrect extends Window {
|
|||
|
||||
@Override
|
||||
public boolean itemSelectable(Item item) {
|
||||
//cannot select ankhs, bags or equippable items that aren't equipped
|
||||
return !(item instanceof Ankh) && !(item instanceof Bag) &&
|
||||
(!(item instanceof EquipableItem) || item.isEquipped(Dungeon.hero) || item instanceof MissileWeapon);
|
||||
//cannot select ankhs or bags or equippable items that aren't equipped
|
||||
return !(item instanceof Ankh || item instanceof Bag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user