mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
* Squelch - Fixed that it was causing a ClassCastException (fixes #3396).
This commit is contained in:
parent
24ff9f7c5e
commit
40f192eafc
4 changed files with 72 additions and 6 deletions
|
|
@ -727,7 +727,23 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
return target.isChosen();
|
||||
}
|
||||
|
||||
if (target.getOriginalTarget() instanceof TargetActivatedAbility) {
|
||||
List<StackObject> stackObjects = new ArrayList<>();
|
||||
for (UUID uuid : ((TargetActivatedAbility) target).possibleTargets(source.getSourceId(), source.getControllerId(), game)) {
|
||||
StackObject stackObject = game.getStack().getStackObject(uuid);
|
||||
if (stackObject != null) {
|
||||
stackObjects.add(stackObject);
|
||||
}
|
||||
}
|
||||
while (!target.isChosen() && !stackObjects.isEmpty()) {
|
||||
StackObject pick = stackObjects.get(0);
|
||||
if (pick != null) {
|
||||
target.addTarget(pick.getId(), source, game);
|
||||
stackObjects.remove(0);
|
||||
}
|
||||
}
|
||||
return target.isChosen();
|
||||
}
|
||||
throw new IllegalStateException("Target wasn't handled. class:" + target.getClass().toString());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue