mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Added check for targeted parameter to AI_getBestEnchantment.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user