diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java index 0edd097f4..1d1c83fa2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java @@ -245,18 +245,25 @@ public class MeleeWeapon extends Weapon { return STRReq(tier, lvl); } + private static boolean evaluatingTwinUpgrades = false; @Override public int buffedLvl() { - if (isEquipped(Dungeon.hero) && Dungeon.hero.hasTalent(Talent.TWIN_UPGRADES)){ + if (!evaluatingTwinUpgrades && isEquipped(Dungeon.hero) && Dungeon.hero.hasTalent(Talent.TWIN_UPGRADES)){ KindOfWeapon other = null; if (Dungeon.hero.belongings.weapon() != this) other = Dungeon.hero.belongings.weapon(); if (Dungeon.hero.belongings.secondWep() != this) other = Dungeon.hero.belongings.secondWep(); - //weaker weapon needs to be 2/1/0 tiers lower, based on talent level - if (other instanceof MeleeWeapon - && (tier+(3-Dungeon.hero.pointsInTalent(Talent.TWIN_UPGRADES))) <= ((MeleeWeapon) other).tier - && other.level() > super.buffedLvl()){ - return other.level(); + if (other instanceof MeleeWeapon) { + evaluatingTwinUpgrades = true; + int otherLevel = other.buffedLvl(); + evaluatingTwinUpgrades = false; + + //weaker weapon needs to be 2/1/0 tiers lower, based on talent level + if ((tier + (3 - Dungeon.hero.pointsInTalent(Talent.TWIN_UPGRADES))) <= ((MeleeWeapon) other).tier + && otherLevel > super.buffedLvl()) { + return otherLevel; + } + } } return super.buffedLvl();