Merge branch 'QuestDraftSetFix' into 'master'

Quest draft set fix

See merge request core-developers/forge!174
This commit is contained in:
Sol
2018-02-11 15:18:12 +00:00

View File

@@ -789,29 +789,13 @@ public class QuestEventDraft implements IQuestEvent {
if (!allowedQuestSets.isEmpty()) { if (!allowedQuestSets.isEmpty()) {
for (final CardBlock block : blocks) { for (final CardBlock block : blocks) {
boolean blockAllowed = false; // New code : all sets must be unlocked
boolean largeSetUnlocked = false; boolean blockAllowed = true;
int unlockedSets = 0;
final boolean allBlocksSanctioned = quest.getFormat().getAllowedSetCodes().isEmpty();
for (final CardEdition set : block.getSets()) { for (CardEdition set : block.getSets()) {
if (!allowedQuestSets.contains(set) && !allBlocksSanctioned) { if (!allowedQuestSets.contains(set)) {
continue; blockAllowed = false;
} }
unlockedSets++;
if (set.isLargeSet()) {
largeSetUnlocked = true;
}
}
//Allow partially unlocked blocks if they contain at least one large and one small unlocked set.
if (largeSetUnlocked && unlockedSets > 1) {
blockAllowed = true;
}
if (largeSetUnlocked && block.getSets().size() == 1) {
blockAllowed = true;
singleSets.add(block.getSets().get(0).getCode());
} }
if (blockAllowed) { if (blockAllowed) {