Refactor: improved choose cards method to use source param (fixed NPE like #10233, #9974 and other bugs with choose cards)

This commit is contained in:
Oleg Agafonov 2023-04-21 11:02:57 +04:00
parent 5474787641
commit 689b93d005
280 changed files with 341 additions and 342 deletions

View file

@ -69,7 +69,7 @@ public class CastCardFromOutsideTheGameEffect extends OneShotEffect {
}
TargetCard target = new TargetCard(Zone.OUTSIDE, filterCard);
if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
if (player.choose(Outcome.Benefit, filteredCards, target, source, game)) {
Card card = player.getSideboard().get(target.getFirstTarget(), game);
if (card != null) {
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);