Fix Rock Hydra crash (#9011)

This commit is contained in:
tool4ever
2025-10-27 20:25:41 +01:00
committed by GitHub
parent 5fc1d4214b
commit 364845ab4e

View File

@@ -3,6 +3,7 @@ package forge.game.ability.effects;
import java.util.Map;
import forge.game.card.*;
import forge.game.replacement.ReplacementType;
import org.apache.commons.lang3.tuple.Pair;
import com.google.common.collect.ImmutableList;
@@ -105,12 +106,11 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
if (sa.hasParam("Choices")) {
ZoneType choiceZone = sa.hasParam("ChoiceZone") ? ZoneType.smartValueOf(sa.getParam("ChoiceZone"))
: ZoneType.Battlefield;
srcCards = CardLists.getValidCards(game.getCardsIn(choiceZone), sa.getParam("Choices"),
activator, source, sa);
srcCards = CardLists.getValidCards(game.getCardsIn(choiceZone), sa.getParam("Choices"), activator, source, sa);
} else {
srcCards = getTargetCards(sa);
}
if (sa.isReplacementAbility()) {
if (sa.isReplacementAbility() && sa.getReplacementEffect().getMode() == ReplacementType.Moved) {
srcCards = new CardCollection(srcCards).filter(c -> !c.isInPlay() || sa.getLastStateBattlefield().contains(c));
}