diff --git a/Mage.Sets/src/mage/cards/g/GoldberryRiverDaughter.java b/Mage.Sets/src/mage/cards/g/GoldberryRiverDaughter.java index 1eb99a28b27..bf82f6bc668 100644 --- a/Mage.Sets/src/mage/cards/g/GoldberryRiverDaughter.java +++ b/Mage.Sets/src/mage/cards/g/GoldberryRiverDaughter.java @@ -93,15 +93,15 @@ class GoldberryRiverDaughterFromEffect extends OneShotEffect { } // Create a set of all of the unique counter types on the target permanent that aren't on Goldberry - Set fromCounters = new HashSet(fromPermanent.getCounters(game).values()); - fromCounters.removeAll(toPermanent.getCounters(game).values()); + Set fromCounters = new HashSet<>(fromPermanent.getCounters(game).keySet()); + fromCounters.removeAll(toPermanent.getCounters(game).keySet()); if (fromCounters.size() == 0) { return false; } - for (Counter counter : fromCounters) { - fromPermanent.removeCounters(counter.getName(), 1, source, game); - toPermanent.addCounters(CounterType.findByName(counter.getName()).createInstance(1), + for (String counter : fromCounters) { + fromPermanent.removeCounters(counter, 1, source, game); + toPermanent.addCounters(CounterType.findByName(counter).createInstance(1), source.getControllerId(), source, game); } return true; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ltr/GoldberryRiverDaughterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ltr/GoldberryRiverDaughterTest.java index a6813df64b4..dd6510563a1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ltr/GoldberryRiverDaughterTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ltr/GoldberryRiverDaughterTest.java @@ -54,6 +54,7 @@ public class GoldberryRiverDaughterTest extends CardTestPlayerBase { @Test // Author: alexander-novo // Unhappy path - Try to remove some counters from something when some of those counters are already on Goldberry + // (but now with different counts, to cover that edge case.) public void testCounterAlreadyOnGoldberry() { CounterType counter = CounterType.ACORN; String island = "Island"; @@ -61,7 +62,7 @@ public class GoldberryRiverDaughterTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, goldberry, 1); addCard(Zone.BATTLEFIELD, playerA, island, 1); - addCounters(1, PhaseStep.PRECOMBAT_MAIN, playerA, island, counter, 1); + addCounters(1, PhaseStep.PRECOMBAT_MAIN, playerA, island, counter, 2); addCounters(1, PhaseStep.PRECOMBAT_MAIN, playerA, goldberry, counter, 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, ability1, island);