From 642de722f62b18e93d5d212cccf5e912105d8039 Mon Sep 17 00:00:00 2001 From: drmDev Date: Sun, 24 Jul 2016 15:00:07 -0400 Subject: [PATCH] Mind Shatter bug fix for #2110. Before a discard effect can happen, checks the amount of cards to be discarded > 0 --- Mage.Sets/src/mage/sets/magic2010/MindShatter.java | 2 -- Mage/src/main/java/mage/players/PlayerImpl.java | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2010/MindShatter.java b/Mage.Sets/src/mage/sets/magic2010/MindShatter.java index b3d6c05d66..d4de7f5c21 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MindShatter.java +++ b/Mage.Sets/src/mage/sets/magic2010/MindShatter.java @@ -28,7 +28,6 @@ package mage.sets.magic2010; import java.util.UUID; - import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; @@ -46,7 +45,6 @@ public class MindShatter extends CardImpl { super(ownerId, 106, "Mind Shatter", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); this.expansionSetCode = "M10"; - // Target player discards X cards at random. this.getSpellAbility().addEffect(new DiscardTargetEffect(new ManacostVariableValue(), true)); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index eaf096d010..6ef55b92c8 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -723,6 +723,9 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public Cards discard(int amount, boolean random, Ability source, Game game) { Cards discardedCards = new CardsImpl(); + if (amount <= 0) { + return discardedCards; + } if (this.getHand().size() == 1 || this.getHand().size() == amount) { discardedCards.addAll(this.getHand()); while (this.getHand().size() > 0) {