v2.1.1: added a few safety checks to the mage's staff
This commit is contained in:
+6
-2
@@ -120,7 +120,11 @@ public class MagesStaff extends MeleeWeapon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int targetingPos(Hero user, int dst) {
|
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
|
@Override
|
||||||
@@ -217,7 +221,7 @@ public class MagesStaff extends MeleeWeapon {
|
|||||||
|
|
||||||
public Item imbueWand(Wand wand, Char owner){
|
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)){
|
if (owner == Dungeon.hero && Dungeon.hero.hasTalent(Talent.WAND_PRESERVATION)){
|
||||||
Talent.WandPreservationCounter counter = Buff.affect(Dungeon.hero, Talent.WandPreservationCounter.class);
|
Talent.WandPreservationCounter counter = Buff.affect(Dungeon.hero, Talent.WandPreservationCounter.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user