The challenge rewards now honor the persistent format if enforced.

This commit is contained in:
RumbleBBU
2012-10-08 07:30:35 +00:00
parent ed394f18cd
commit 6e0fa8627f

View File

@@ -28,6 +28,8 @@ import com.google.common.collect.Iterables;
import forge.AllZone;
import forge.Singletons;
import forge.card.BoosterGenerator;
import forge.card.CardRulesPredicates;
import forge.card.CardRules;
@@ -259,6 +261,9 @@ public final class BoosterUtils {
};
Predicate<CardPrinted> colorPred = Predicates.compose(col, CardPrinted.FN_GET_RULES);
Predicate<CardPrinted> rarAndColor = Predicates.and(rar, colorPred);
if (AllZone.getQuest().getFormat() != null) {
rarAndColor = Predicates.and(AllZone.getQuest().getFormat().getFilterPrinted(), rarAndColor);
}
return new UnOpenedProduct(openWay, new BoosterGenerator(rarAndColor)); // qty))
}
}