From a71d5a134b3fcf4d396bd68f2dcd94cebfae8754 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 5 Sep 2015 20:17:39 +1000 Subject: [PATCH] Fix rating when no categories are configured --- .../intellectualcrafters/plot/object/Rating.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/object/Rating.java b/src/main/java/com/intellectualcrafters/plot/object/Rating.java index d2928b687..f904750d0 100644 --- a/src/main/java/com/intellectualcrafters/plot/object/Rating.java +++ b/src/main/java/com/intellectualcrafters/plot/object/Rating.java @@ -20,14 +20,14 @@ public class Rating { public Rating(int value) { this.initial = value; ratingMap = new HashMap<>(); - if (value < 10) { - for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) { - ratingMap.put(Settings.RATING_CATEGORIES.get(i), value); - } - changed = true; - return; - } if (Settings.RATING_CATEGORIES != null && Settings.RATING_CATEGORIES.size() > 1) { + if (value < 10) { + for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) { + ratingMap.put(Settings.RATING_CATEGORIES.get(i), value); + } + changed = true; + return; + } for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) { ratingMap.put(Settings.RATING_CATEGORIES.get(i), (value % 10) - 1); value /= 10;