Bounds checking for unlocking.

This commit is contained in:
RumbleBBU
2012-11-16 08:49:21 +00:00
parent cffc9de1f8
commit c78252b58d

View File

@@ -162,8 +162,12 @@ public class QuestUtilUnlockSets {
Collections.reverse(options);
final int nrChoices = Math.min(8, 2 + ((qData.getAchievements().getWin()) / 50));
List<CardEdition> choices = new ArrayList<CardEdition>();
if (options.size() <= nrChoices) {
return Collections.unmodifiableList(options);
}
List<CardEdition> choices = new ArrayList<CardEdition>();
for (int i = 0; i < nrChoices; i++) {
choices.add(options.get(i));
}