v2.1.1: added a few safety checks to the mage's staff

This commit is contained in:
Evan Debenham
2023-06-08 15:59:29 -04:00
parent a49215ccc7
commit b4ba9c9b91

View File

@@ -120,7 +120,11 @@ public class MagesStaff extends MeleeWeapon {
@Override
public int targetingPos(Hero user, int dst) {
return wand.targetingPos(user, dst);
if (wand != null) {
return wand.targetingPos(user, dst);
} else {
return super.targetingPos(user, dst);
}
}
@Override
@@ -217,7 +221,7 @@ public class MagesStaff extends MeleeWeapon {
public Item imbueWand(Wand wand, Char owner){
int oldStaffcharges = this.wand.curCharges;
int oldStaffcharges = this.wand != null ? this.wand.curCharges : 0;
if (owner == Dungeon.hero && Dungeon.hero.hasTalent(Talent.WAND_PRESERVATION)){
Talent.WandPreservationCounter counter = Buff.affect(Dungeon.hero, Talent.WandPreservationCounter.class);