From 7c1e813beaac405e620f67826f8870ab5813f879 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 27 Apr 2023 14:09:02 -0400 Subject: [PATCH] v2.1.0: fixed scroll of transmutation triggering swift equip --- .../shatteredpixeldungeon/items/KindOfWeapon.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindOfWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindOfWeapon.java index b9a173f84..1b35d0ded 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindOfWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/KindOfWeapon.java @@ -100,7 +100,7 @@ abstract public class KindOfWeapon extends EquipableItem { @Override public boolean doEquip( Hero hero ) { - + boolean wasInInv = hero.belongings.contains(this); detachAll( hero.belongings.backpack ); if (hero.belongings.weapon == null || hero.belongings.weapon.doUnequip( hero, true )) { @@ -118,7 +118,7 @@ abstract public class KindOfWeapon extends EquipableItem { GLog.n( Messages.get(KindOfWeapon.class, "equip_cursed") ); } - if (hero.hasTalent(Talent.SWIFT_EQUIP)) { + if (wasInInv && hero.hasTalent(Talent.SWIFT_EQUIP)) { if (hero.buff(Talent.SwiftEquipCooldown.class) == null){ hero.spendAndNext(-hero.cooldown()); Buff.affect(hero, Talent.SwiftEquipCooldown.class, 19f) @@ -144,6 +144,7 @@ abstract public class KindOfWeapon extends EquipableItem { } public boolean equipSecondary( Hero hero ){ + boolean wasInInv = hero.belongings.contains(this); detachAll( hero.belongings.backpack ); if (hero.belongings.secondWep == null || hero.belongings.secondWep.doUnequip( hero, true )) { @@ -161,7 +162,7 @@ abstract public class KindOfWeapon extends EquipableItem { GLog.n( Messages.get(KindOfWeapon.class, "equip_cursed") ); } - if (hero.hasTalent(Talent.SWIFT_EQUIP)) { + if (wasInInv && hero.hasTalent(Talent.SWIFT_EQUIP)) { if (hero.buff(Talent.SwiftEquipCooldown.class) == null){ hero.spendAndNext(-hero.cooldown()); Buff.affect(hero, Talent.SwiftEquipCooldown.class, 19f)