From dbcdd9e478a42054febf5d0156bf794c684809b7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 26 Jul 2025 20:18:05 -0400 Subject: [PATCH] v3.2.0: fixed incorrect ID text when last thrown weapon is consumed --- .../shatteredpixeldungeon/items/weapon/Weapon.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index e54a5b554..126d7fc88 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -170,6 +170,14 @@ abstract public class Weapon extends KindOfWeapon { defender.damage(Smite.bonusDmg((Hero) attacker, defender), Smite.INSTANCE); } } + + //do not progress toward ID in the specific case of a missile weapon with no parent using + // up it's last shot, as in this case there's nothing left to ID anyway + if (this instanceof MissileWeapon + && ((MissileWeapon) this).durabilityLeft() <= ((MissileWeapon) this).durabilityPerUse() + && ((MissileWeapon) this).parent == null){ + return damage; + } if (!levelKnown && attacker == Dungeon.hero) { float uses = Math.min( availableUsesToID, Talent.itemIDSpeedFactor(Dungeon.hero, this) );