Merge branch 'master' into 'master'

Code simplification/cleanup.

See merge request core-developers/forge!1223
This commit is contained in:
Michael Kamensky
2018-12-13 19:10:59 +00:00

View File

@@ -1067,14 +1067,6 @@ public class DamageDealAi extends DamageAiBase {
// Ensure that the chained spell can target at least the same things (or more) as the current one // Ensure that the chained spell can target at least the same things (or more) as the current one
TargetRestrictions tgtSa = sa.getTargetRestrictions(); TargetRestrictions tgtSa = sa.getTargetRestrictions();
TargetRestrictions tgtAb = sa.getTargetRestrictions(); TargetRestrictions tgtAb = sa.getTargetRestrictions();
if (tgtSa.canTgtCreature() && !tgtAb.canTgtCreature()) {
continue;
} else if (tgtSa.canTgtPlaneswalker() && !tgtAb.canTgtPlaneswalker()) {
continue;
}
// Check that "ab" has a ValidTgts specification that includes everything "sa" includes, or
// the AI can misplay
String[] validTgtsSa = tgtSa.getValidTgts(); String[] validTgtsSa = tgtSa.getValidTgts();
String[] validTgtsAb = tgtAb.getValidTgts(); String[] validTgtsAb = tgtAb.getValidTgts();
if (!Arrays.asList(validTgtsSa).containsAll(Arrays.asList(validTgtsAb))) { if (!Arrays.asList(validTgtsSa).containsAll(Arrays.asList(validTgtsAb))) {