v0.7.0: fixed weapons being identified when not used by the hero

This commit is contained in:
Evan Debenham 2018-07-15 20:12:12 -04:00
parent 1f24e84ee4
commit 04fe09cdc6

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.weapon; package com.shatteredpixel.shatteredpixeldungeon.items.weapon;
import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
@ -99,7 +100,7 @@ abstract public class Weapon extends KindOfWeapon {
damage = enchantment.proc( this, attacker, defender, damage ); damage = enchantment.proc( this, attacker, defender, damage );
} }
if (!levelKnown) { if (!levelKnown && attacker == Dungeon.hero) {
if (--hitsToKnow <= 0) { if (--hitsToKnow <= 0) {
identify(); identify();
GLog.i( Messages.get(Weapon.class, "identify") ); GLog.i( Messages.get(Weapon.class, "identify") );