From 14cd2dfa6d42249bbb41266ab353de7fc86fdccf Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 14 Sep 2016 22:31:04 +0200 Subject: [PATCH] * Jeleva, Nephalia's Scourge and Knowledge Pool - Fixed a bug that created null pointer exception if card was cast from exile. --- .../sets/commander2013/JelevaNephaliasScourge.java | 1 - .../src/mage/sets/mirrodinbesieged/KnowledgePool.java | 1 - Mage/src/main/java/mage/players/PlayerImpl.java | 11 ++++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/sets/commander2013/JelevaNephaliasScourge.java b/Mage.Sets/src/mage/sets/commander2013/JelevaNephaliasScourge.java index 41a7479fc1..4065727010 100644 --- a/Mage.Sets/src/mage/sets/commander2013/JelevaNephaliasScourge.java +++ b/Mage.Sets/src/mage/sets/commander2013/JelevaNephaliasScourge.java @@ -160,7 +160,6 @@ class JelevaNephaliasCastEffect extends OneShotEffect { if (controller.choose(Outcome.PlayForFree, exileZone, target, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - game.getExile().removeCard(card, game); return controller.cast(card.getSpellAbility(), game, true); } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java index 8e5c3114ca..1d587e3dc8 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java @@ -178,7 +178,6 @@ class KnowledgePoolEffect2 extends OneShotEffect { while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(exileZoneId), target, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null && !card.getId().equals(spell.getSourceId())) { - game.getExile().removeCard(card, game); return player.cast(card.getSpellAbility(), game, true); } target.clearChosen(); diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 00a7ae3a59..ecc11fbc66 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -40,7 +40,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Map.Entry; -import java.util.Random; import java.util.Set; import java.util.UUID; import mage.ConditionalMana; @@ -83,7 +82,6 @@ import mage.actions.MageDrawAction; import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; -import mage.cards.MeldCard; import mage.cards.SplitCard; import mage.cards.decks.Deck; import mage.constants.AbilityType; @@ -118,7 +116,6 @@ import mage.game.events.ZoneChangeEvent; import mage.game.match.MatchPlayer; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentCard; -import mage.game.permanent.PermanentMeld; import mage.game.stack.Spell; import mage.game.stack.StackAbility; import mage.game.stack.StackObject; @@ -1852,7 +1849,7 @@ public abstract class PlayerImpl implements Player, Serializable { returnCode = false; } } - if(finalAmount > 0) { + if (finalAmount > 0) { game.fireEvent(GameEvent.getEvent(EventType.COUNTERS_ADDED, playerId, playerId, counter.getName(), amount)); } } else { @@ -3161,9 +3158,9 @@ public abstract class PlayerImpl implements Player, Serializable { if (permanent != null) { successfulMovedCards.add(permanent); if (!game.isSimulation()) { - game.informPlayers(game.getPlayer(info.event.getPlayerId()) + " puts " + - (info.faceDown ? "a card face down " : permanent.getLogName()) + " from " + - fromZone.toString().toLowerCase(Locale.ENGLISH) + " onto the Battlefield"); + game.informPlayers(game.getPlayer(info.event.getPlayerId()) + " puts " + + (info.faceDown ? "a card face down " : permanent.getLogName()) + " from " + + fromZone.toString().toLowerCase(Locale.ENGLISH) + " onto the Battlefield"); } } }