From df0528721ed9437fb9e638c09cefcc0ed8ea51e8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 14 Feb 2021 11:44:14 -0500 Subject: [PATCH] v0.9.2: fixed two crash bugs caused by new talents --- .../shatteredpixeldungeon/items/wands/Wand.java | 8 ++++---- .../shatteredpixeldungeon/items/weapon/Weapon.java | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index db04b900b..60e602595 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -304,11 +304,11 @@ public abstract class Wand extends Item { public int buffedLvl() { int lvl = super.buffedLvl(); - if (charger.target.buff(Talent.EmpoweringScrollsTracker.class) != null){ - lvl += Dungeon.hero.pointsInTalent(Talent.EMPOWERING_SCROLLS); - } - if (charger != null && charger.target != null) { + if (charger.target.buff(Talent.EmpoweringScrollsTracker.class) != null){ + lvl += Dungeon.hero.pointsInTalent(Talent.EMPOWERING_SCROLLS); + } + WandOfMagicMissile.MagicCharge buff = charger.target.buff(WandOfMagicMissile.MagicCharge.class); if (buff != null && buff.level() > lvl){ return buff.level(); 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 82622d327..4d5f0a37b 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 @@ -351,7 +351,9 @@ abstract public class Weapon extends KindOfWeapon { float multi = 1f; if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.ENRAGED_CATALYST)){ Berserk rage = attacker.buff(Berserk.class); - multi += 0.2f*rage.rageAmount()*((Hero) attacker).pointsInTalent(Talent.ENRAGED_CATALYST); + if (rage != null) { + multi += 0.2f * rage.rageAmount() * ((Hero) attacker).pointsInTalent(Talent.ENRAGED_CATALYST); + } } return multi; }