Added check for targeted parameter to AI_getBestEnchantment.

This commit is contained in:
jendave
2011-08-06 05:23:22 +00:00
parent 0ac0329c6a
commit cb3d9d7863

View File

@@ -130,13 +130,15 @@ public class CardFactoryUtil {
public static Card AI_getBestEnchantment(CardList list, final Card spell, boolean targeted) {
CardList all = list;
all = all.getType("Enchantment");
if (targeted)
{
all = all.filter(new CardListFilter() {
public boolean addCard(Card c) {
return CardFactoryUtil.canTarget(spell, c);
}
});
}
if(all.size() == 0) {
return null;
}