v0.6.2: improved logic for swapping misc items with a full inventory

This commit is contained in:
Evan Debenham 2017-10-11 22:44:40 -04:00
parent deb626e279
commit 939c000a22

View File

@ -50,9 +50,17 @@ public abstract class KindofMisc extends EquipableItem {
protected void onSelect(int index) { protected void onSelect(int index) {
KindofMisc equipped = (index == 0 ? m1 : m2); KindofMisc equipped = (index == 0 ? m1 : m2);
if (equipped.doUnequip(hero, true, false)) { if (!equipped.cursed) {
if (index == 0){
hero.belongings.misc1 = null;
} else {
hero.belongings.misc2 = null;
}
//fully re-execute rather than just call doEquip as we want to preserve quickslot //fully re-execute rather than just call doEquip as we want to preserve quickslot
execute(hero, AC_EQUIP); execute(hero, AC_EQUIP);
equipped.collect();
} else {
GLog.w(Messages.get(EquipableItem.class, "unequip_cursed"));
} }
} }
}); });