- Fixed the AI crashing the game when trying to play Profaner of the Dead (which can happen, for instance, when exiling one from opponent's library and playing it without paying mana cost).

This commit is contained in:
Agetian
2017-01-27 14:29:27 +00:00
parent 6cc58919f3
commit f54198d97e

View File

@@ -279,6 +279,13 @@ public class ChangeZoneAllAi extends SpellAbilityAi {
final ZoneType destination = ZoneType.smartValueOf(sa.getParam("Destination"));
final ZoneType origin = ZoneType.listValueOf(sa.getParam("Origin")).get(0);
if (sa.getHostCard().getName().equals("Profaner of the Dead")) {
// TODO: this is a stub to prevent the AI from crashing the game when, for instance, playing the opponent's
// Profaner from exile without paying its mana cost. Otherwise the card is marked RemAIDeck and there is no
// specific AI to support playing it in a smarter way. Feel free to expand.
return !CardLists.filter(ai.getOpponents().getCardsIn(origin), CardPredicates.Presets.CREATURES).isEmpty();
}
CardCollectionView humanType = CardLists.filterControlledBy(ai.getGame().getCardsIn(origin), ai.getOpponents());
humanType = AbilityUtils.filterListByType(humanType, sa.getParam("ChangeType"), sa);