diff --git a/src/engine/objects/ItemBase.java b/src/engine/objects/ItemBase.java index 4200ab7f..6f449203 100644 --- a/src/engine/objects/ItemBase.java +++ b/src/engine/objects/ItemBase.java @@ -969,14 +969,16 @@ public class ItemBase { } public Boolean ValidClass(Enum.ClassType base,Enum.ClassType profession){ - if(this.requiredClasses.isEmpty() && this.restrictedClasses.isEmpty()) + boolean requiredEmpty = this.requiredClasses == null || this.requiredClasses.isEmpty(); + boolean restrictedEmpty = this.restrictedClasses == null || this.restrictedClasses.isEmpty(); + if(requiredEmpty && restrictedEmpty) return true; - if(this.requiredClasses.isEmpty() == false) + if(this.requiredClasses != null && this.requiredClasses.isEmpty() == false) if(this.requiredClasses.contains(base) || this.requiredClasses.contains(profession)) return true; - if(this.restrictedClasses.isEmpty() == false) + if(this.restrictedClasses != null && this.restrictedClasses.isEmpty() == false) if(this.restrictedClasses.contains(base) == false && this.restrictedClasses.contains(profession) == false) return true; @@ -984,7 +986,9 @@ public class ItemBase { } public Boolean ValidDiscipline(EnumSet discs){ - if(this.requiredDiscs.isEmpty() && this.restrictedDiscs.isEmpty()) + boolean requiredEmpty = this.requiredDiscs == null || this.requiredDiscs.isEmpty(); + boolean restrictedEmpty = this.restrictedDiscs == null || this.restrictedDiscs.isEmpty(); + if(requiredEmpty && restrictedEmpty) return true; for(Enum.DisciplineType disc : discs){ diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index c973b61c..eecca954 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -4575,11 +4575,15 @@ public class PlayerCharacter extends AbstractCharacter { else this.absGender = SexType.FEMALE; + for(CharacterRune rune : this.runes){ try { DisciplineType disc = DisciplineType.valueOf(RuneBase.getRuneBase(rune.getRuneBaseID()).getName().replace("-", "").replace(" ", "")); if (disc != null) { - this.absDisciplines.add(disc); + if(this.absDisciplines == null) + this.absDisciplines = EnumSet.of(disc); + else + this.absDisciplines.add(disc); } } catch(Exception e){