v0.6.2: properly fixed juggling misc equips when inventory is full
This commit is contained in:
parent
7f965f1777
commit
55090000a7
|
@ -50,18 +50,13 @@ 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.cursed) {
|
//temporarily give 1 extra backpack spot to support swapping with a full inventory
|
||||||
if (index == 0){
|
hero.belongings.backpack.size++;
|
||||||
hero.belongings.misc1 = null;
|
if (equipped.doUnequip(hero, true, false)) {
|
||||||
} 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"));
|
|
||||||
}
|
}
|
||||||
|
hero.belongings.backpack.size--;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user