From 55090000a73f33474a88b171f07f49749e182e9b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 15 Oct 2017 15:33:54 -0400 Subject: [PATCH] v0.6.2: properly fixed juggling misc equips when inventory is full --- .../shatteredpixeldungeon/items/KindofMisc.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java index a14650ffc..fc37f6a5c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindofMisc.java @@ -50,18 +50,13 @@ public abstract class KindofMisc extends EquipableItem { protected void onSelect(int index) { KindofMisc equipped = (index == 0 ? m1 : m2); - if (!equipped.cursed) { - if (index == 0){ - hero.belongings.misc1 = null; - } else { - hero.belongings.misc2 = null; - } + //temporarily give 1 extra backpack spot to support swapping with a full inventory + hero.belongings.backpack.size++; + if (equipped.doUnequip(hero, true, false)) { //fully re-execute rather than just call doEquip as we want to preserve quickslot execute(hero, AC_EQUIP); - equipped.collect(); - } else { - GLog.w(Messages.get(EquipableItem.class, "unequip_cursed")); } + hero.belongings.backpack.size--; } });