From 561a5a3d0e3dd218a148339f55f0753b470cbc47 Mon Sep 17 00:00:00 2001 From: Alex Vasile <48962821+Alex-Vasile@users.noreply.github.com> Date: Wed, 25 May 2022 23:18:01 -0600 Subject: [PATCH] Fixed error I introduced in canTarget() --- .../common/TargetCardInASingleGraveyard.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Mage/src/main/java/mage/target/common/TargetCardInASingleGraveyard.java b/Mage/src/main/java/mage/target/common/TargetCardInASingleGraveyard.java index b6fe654667c..c737fff4b8f 100644 --- a/Mage/src/main/java/mage/target/common/TargetCardInASingleGraveyard.java +++ b/Mage/src/main/java/mage/target/common/TargetCardInASingleGraveyard.java @@ -31,16 +31,17 @@ public class TargetCardInASingleGraveyard extends TargetCard { @Override public boolean canTarget(UUID id, Ability source, Game game) { UUID firstTarget = this.getFirstTarget(); - if (firstTarget == null) { - return false; - } - - Card card = game.getCard(firstTarget); - Card targetCard = game.getCard(id); - if (card == null || targetCard == null || !card.isOwnedBy(targetCard.getOwnerId())) { - return false; + + // If a card is already targeted, ensure that this new target has the same owner as currently chosen target + if (firstTarget != null) { + Card card = game.getCard(firstTarget); + Card targetCard = game.getCard(id); + if (card == null || targetCard == null || !card.isOwnedBy(targetCard.getOwnerId())) { + return false; + } } + // If it has the same owner (or no target picked) check that it's a valid target with super return super.canTarget(id, source, game); }