From 5af6b6ca7ab5042ed46414c6574dd4312c55ca2a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 20 Mar 2015 15:10:54 +0100 Subject: [PATCH] Fixed a bug that could lead to endless loops if cards where moved from library to graveyard. --- .../src/mage/sets/returntoravnica/CorpsejackMenace.java | 9 +++++++-- Mage/src/mage/players/PlayerImpl.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/returntoravnica/CorpsejackMenace.java b/Mage.Sets/src/mage/sets/returntoravnica/CorpsejackMenace.java index 27b4c91be5..469717d775 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/CorpsejackMenace.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/CorpsejackMenace.java @@ -101,10 +101,15 @@ class CorpsejackMenaceReplacementEffect extends ReplacementEffectImpl { } return true; } - + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ADD_COUNTERS; + } + @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.ADD_COUNTER && event.getData().equals(CounterType.P1P1.getName())) { + if (event.getData().equals(CounterType.P1P1.getName())) { Permanent target = game.getPermanent(event.getTargetId()); if (target != null && target.getControllerId().equals(source.getControllerId()) && target.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 8a49e96cf1..7e97842602 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2786,7 +2786,7 @@ public abstract class PlayerImpl implements Player, Serializable { cards.add(card); } } - allCards.removeAll(cards); + allCards.removeAll(cards.getCards(game)); // move cards ot graveyard in order the owner decides if (cards.size() != 0) { TargetCard target = new TargetCard(fromZone, new FilterCard("card to put on the top of your graveyard (last one chosen will be topmost)"));