mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Fixed the AI changing targets of triggers with "OptionalDecider" before resolving.
This commit is contained in:
@@ -124,6 +124,17 @@ public class TargetChoices {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* clear.
|
||||
* </p>
|
||||
*/
|
||||
public final void clear() {
|
||||
this.targetPlayers.clear();
|
||||
this.targetCards.clear();
|
||||
this.targetSAs.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* removeTarget.
|
||||
|
||||
@@ -978,10 +978,21 @@ public class TriggerHandler {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ArrayList<Object> tgts = null;
|
||||
// make sure the targets won't change
|
||||
if (sa[0].getTarget() != null) {
|
||||
tgts = new ArrayList<Object>(sa[0].getTarget().getTargetChoices().getTargets());
|
||||
}
|
||||
// This isn't quite right, but better than canPlayAI
|
||||
if (!sa[0].doTrigger(isMandatory)) {
|
||||
return;
|
||||
}
|
||||
if (sa[0].getTarget() != null) {
|
||||
for (Object tgt : tgts) {
|
||||
sa[0].getTarget().getTargetChoices().clear();
|
||||
sa[0].getTarget().getTargetChoices().addTarget(tgt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user