mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
* Fixed a bug that could lock the game if you should pick more cards from shown cards from your library than cards left in your library (e.g. Dig Through Time).
This commit is contained in:
parent
557ac244d3
commit
eeb938af94
1 changed files with 3 additions and 1 deletions
|
|
@ -29,6 +29,7 @@
|
|||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import static java.lang.Integer.min;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
|
@ -186,7 +187,8 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), source, game)) {
|
||||
FilterCard pickFilter = filter.copy();
|
||||
pickFilter.setMessage(getPickText());
|
||||
TargetCard target = new TargetCard((upTo ? 0 : numberToPick.calculate(game, source, this)), numberToPick.calculate(game, source, this), Zone.LIBRARY, pickFilter);
|
||||
int number = min(cards.size(), numberToPick.calculate(game, source, this));
|
||||
TargetCard target = new TargetCard((upTo ? 0 : number), number, Zone.LIBRARY, pickFilter);
|
||||
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
Cards pickedCards = new CardsImpl(target.getTargets());
|
||||
cards.removeAll(pickedCards);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue