v0.7.0: fixed mirror image crashes with mage's staff

This commit is contained in:
Evan Debenham 2018-07-04 12:43:17 -04:00
parent 718d9b6c7d
commit 6ebb77a1b7

View File

@ -130,7 +130,8 @@ public class MagesStaff extends MeleeWeapon {
@Override
public int proc(Char attacker, Char defender, int damage) {
if (wand != null && Dungeon.hero.subClass == HeroSubClass.BATTLEMAGE) {
if (wand != null &&
attacker instanceof Hero && ((Hero)attacker).subClass == HeroSubClass.BATTLEMAGE) {
if (wand.curCharges < wand.maxCharges) wand.partialCharge += 0.33f;
ScrollOfRecharging.charge((Hero)attacker);
wand.onHit(this, attacker, defender, damage);