[RAV] fixed an error with Bottled Cloiser (fixes #7849)

This commit is contained in:
Evan Kranzler 2021-05-31 15:19:10 -04:00
parent ed0f921a77
commit 65c4ed7e5b

View file

@ -12,7 +12,6 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.ExileZone;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
@ -103,12 +102,12 @@ class BottledCloisterReturnEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source));
Cards cards = new CardsImpl(exileZone);
cards.removeIf(uuid -> !player.getId().equals(game.getOwnerId(uuid)));
if (!cards.isEmpty()) {
player.moveCards(cards, Zone.HAND, source, game);
if (player == null) {
return false;
}
Cards cards = new CardsImpl(game.getExile().getExileZone(CardUtil.getExileZoneId(game, source)).getCards(game));
cards.removeIf(uuid -> !player.getId().equals(game.getOwnerId(uuid)));
player.moveCards(cards, Zone.HAND, source, game);
player.drawCards(1, source, game);
return true;
}