AI: fixed game freeze on free cast of multiple cards (part of #13638, #13766);

refactor: fixed that TargetCard doesn't work with Zone.ALL;
This commit is contained in:
Oleg Agafonov 2025-06-29 14:36:54 +04:00
parent bfceb07c58
commit 450f7bd907
13 changed files with 257 additions and 38 deletions

View file

@ -45,9 +45,8 @@ public class PossibleTargetsSelector {
public void findNewTargets(Set<UUID> fromTargetsList) {
// collect new valid targets
List<MageItem> found = target.possibleTargets(abilityControllerId, source, game).stream()
List<MageItem> found = target.possibleTargets(abilityControllerId, source, game, fromTargetsList).stream()
.filter(id -> !target.contains(id))
.filter(id -> fromTargetsList == null || fromTargetsList.contains(id))
.filter(id -> target.canTarget(abilityControllerId, id, source, game))
.map(id -> {
Player player = game.getPlayer(id);