* AI: fixed that computer can cancel "target player or planeswalker" spells on bad effects (can't choose himself);

This commit is contained in:
Oleg Agafonov 2020-07-07 06:31:06 +04:00
parent ff54141e97
commit 55f2893fc4
2 changed files with 13 additions and 8 deletions

View file

@ -329,8 +329,9 @@ public abstract class AbilityImpl implements Ability {
}
if (!getTargets().isEmpty()) {
Outcome outcome = getEffects().getOutcome(this);
// only activated abilities can be canceled by user (not triggered)
if (!getTargets().chooseTargets(outcome, this.controllerId, this, noMana, game, this instanceof ActivatedAbility)) {
// only activated abilities can be canceled by human user (not triggered)
boolean canCancel = this instanceof ActivatedAbility && controller.isHuman();
if (!getTargets().chooseTargets(outcome, this.controllerId, this, noMana, game, canCancel)) {
// was canceled during targer selection
return false;
}