v3.0.0: added hero ref safety checks to isEquipped
This commit is contained in:
@@ -92,7 +92,7 @@ abstract public class KindOfWeapon extends EquipableItem {
|
||||
|
||||
@Override
|
||||
public boolean isEquipped( Hero hero ) {
|
||||
return hero.belongings.weapon() == this || hero.belongings.secondWep() == this;
|
||||
return hero != null && (hero.belongings.weapon() == this || hero.belongings.secondWep() == this);
|
||||
}
|
||||
|
||||
private static boolean isSwiftEquipping = false;
|
||||
|
||||
@@ -304,7 +304,7 @@ public class Armor extends EquipableItem {
|
||||
|
||||
@Override
|
||||
public boolean isEquipped( Hero hero ) {
|
||||
return hero.belongings.armor() == this;
|
||||
return hero != null && hero.belongings.armor() == this;
|
||||
}
|
||||
|
||||
public final int DRMax(){
|
||||
|
||||
Reference in New Issue
Block a user