v0.9.2: fixed a crash caused by excess charge talent

This commit is contained in:
Evan Debenham 2021-02-13 20:07:57 -05:00
parent 82aec9cc86
commit 7bf3cacbb3

View File

@ -153,7 +153,7 @@ public class MagesStaff extends MeleeWeapon {
damage = Math.round( damage * (1f + Dungeon.hero.pointsInTalent(Talent.EMPOWERED_STRIKE)/6f)); damage = Math.round( damage * (1f + Dungeon.hero.pointsInTalent(Talent.EMPOWERED_STRIKE)/6f));
} }
if (wand.curCharges == wand.maxCharges && Random.Int(6) < ((Hero) attacker).pointsInTalent(Talent.EXCESS_CHARGE)){ if (wand.curCharges == wand.maxCharges && attacker instanceof Hero && Random.Int(6) < ((Hero) attacker).pointsInTalent(Talent.EXCESS_CHARGE)){
Buff.affect(attacker, Barrier.class).setShield(buffedLvl()*2); Buff.affect(attacker, Barrier.class).setShield(buffedLvl()*2);
} }