mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- 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:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user