Преглед изворни кода

Bug fix - features were fetches off-by-one

Sam Jaffe пре 8 година
родитељ
комит
1a511d90aa
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      src/main/lombok/org/leumasjaffe/charsheet/model/DDClass.java

+ 2 - 1
src/main/lombok/org/leumasjaffe/charsheet/model/DDClass.java

@@ -78,7 +78,8 @@ public class DDClass {
 	}
 
 	public List<DDProperty> getFeatures(int level) {
-		return features.size() > level ? Collections.unmodifiableList(features.get(level)) : Collections.emptyList();
+		return features.size() < level ? Collections.emptyList() :
+			Collections.unmodifiableList(features.get(level-1));
 	}
 
 	public Optional<DDSpellbook> createNewSpellBook()  {