fixed Relentless Pursuit (NPE errors)

This commit is contained in:
Oleg Agafonov 2020-01-12 08:05:26 +04:00
parent cff44f1436
commit 56d52899c8

View file

@ -89,15 +89,19 @@ class RelentlessPursuitEffect extends OneShotEffect {
if (creatureCardFound) { if (creatureCardFound) {
TargetCard target = new TargetCardInLibrary(0, 1, creatureFilter); TargetCard target = new TargetCardInLibrary(0, 1, creatureFilter);
controller.chooseTarget(Outcome.DrawCard, cards, target, source, game); controller.chooseTarget(Outcome.DrawCard, cards, target, source, game);
if (target.getFirstTarget() != null) {
cards.remove(target.getFirstTarget()); cards.remove(target.getFirstTarget());
cardsToHand.add(target.getFirstTarget()); cardsToHand.add(target.getFirstTarget());
} }
}
if (landCardFound) { if (landCardFound) {
TargetCard target = new TargetCardInLibrary(0, 1, landFilter); TargetCard target = new TargetCardInLibrary(0, 1, landFilter);
controller.chooseTarget(Outcome.DrawCard, cards, target, source, game); controller.chooseTarget(Outcome.DrawCard, cards, target, source, game);
if (target.getFirstTarget() != null) {
cards.remove(target.getFirstTarget()); cards.remove(target.getFirstTarget());
cardsToHand.add(target.getFirstTarget()); cardsToHand.add(target.getFirstTarget());
} }
}
controller.moveCards(cardsToHand, Zone.HAND, source, game); controller.moveCards(cardsToHand, Zone.HAND, source, game);
controller.moveCards(cards, Zone.GRAVEYARD, source, game); controller.moveCards(cards, Zone.GRAVEYARD, source, game);
return true; return true;