- A more in-depth check for target equality when comparing SAs, fixes certain cards not guessing that they are looking at the ability they need to be looking at (e.g. Grip of Chaos).

This commit is contained in:
Agetian
2017-01-11 07:20:38 +00:00
parent 7c0a8412c9
commit a80119b74a

View File

@@ -325,8 +325,16 @@ public class SpellAbilityStackInstance implements IIdentifiable, IHasCardView {
while (compare != null && sub != null) { while (compare != null && sub != null) {
TargetChoices choices = compare.getTargetRestrictions() != null ? compare.getTargets() : null; TargetChoices choices = compare.getTargetRestrictions() != null ? compare.getTargets() : null;
if (choices != null && !choices.equals(sub.getTargetChoices())) { if (choices != null) {
return false; TargetChoices subChoices = sub.getTargetChoices();
if (subChoices == null || choices.getTargets().size() != subChoices.getTargets().size()) {
return false;
}
for (int i = 0; i < choices.getTargets().size(); i++) {
if (!choices.getTargets().get(i).equals(subChoices.getTargets().get(i))) {
return false;
}
}
} }
compare = compare.getSubAbility(); compare = compare.getSubAbility();
sub = sub.getSubInstance(); sub = sub.getSubInstance();