From 6584079d7a99fd001f98e8d8a975cbdcc3a6bfea Mon Sep 17 00:00:00 2001 From: drmDev Date: Mon, 25 Jul 2016 06:43:51 -0400 Subject: [PATCH] bug fix for Tunnel Vision when it does not find card in library --- Mage.Sets/src/mage/sets/ravnica/TunnelVision.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/ravnica/TunnelVision.java b/Mage.Sets/src/mage/sets/ravnica/TunnelVision.java index eb3832e475..76cb7803a5 100644 --- a/Mage.Sets/src/mage/sets/ravnica/TunnelVision.java +++ b/Mage.Sets/src/mage/sets/ravnica/TunnelVision.java @@ -99,6 +99,7 @@ class TunnelVisionEffect extends OneShotEffect { Cards cardsToReveal = new CardsImpl(); Cards cardsToBury = new CardsImpl(); + Card namedCard = null; // reveal until named card found // if named card found, put all revealed cards in grave and put named card on top of library @@ -109,9 +110,8 @@ class TunnelVisionEffect extends OneShotEffect { if (card != null) { cardsToReveal.add(card); if (card.getName().equals(cardName)) { - namedCardFound = true; - targetPlayer.moveCards(cardsToBury, Zone.GRAVEYARD, source, game); - targetPlayer.moveCards(card, Zone.LIBRARY, source, game); + namedCardFound = true; + namedCard = card; break; } else { cardsToBury.add(card); @@ -119,8 +119,11 @@ class TunnelVisionEffect extends OneShotEffect { } } - targetPlayer.revealCards(sourceObject.getIdName(), cardsToReveal, game); - if (!namedCardFound) { + targetPlayer.revealCards(sourceObject.getIdName(), cardsToReveal, game); + if (namedCardFound) { + targetPlayer.moveCards(cardsToBury, Zone.GRAVEYARD, source, game); + targetPlayer.moveCards(namedCard, Zone.LIBRARY, source, game); + } else { targetPlayer.shuffleLibrary(source, game); }