v2.1.1: added a few safety checks to the mage's staff
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user