Merge branch 'assorted-fixes' into 'master'

Fixed Exalted and possibly other triggers with overwriting ability crashing the AI

See merge request core-developers/forge!481
This commit is contained in:
Michael Kamensky
2018-04-26 04:35:25 +00:00

View File

@@ -1383,7 +1383,9 @@ public class ComputerUtil {
if (c.isCreature() && c.isInZone(ZoneType.Battlefield) && CombatUtil.canAttack(c)) {
for (final Trigger t : c.getTriggers()) {
if ("Attacks".equals(t.getParam("Mode")) && t.hasParam("Execute")) {
SpellAbility trigSa = AbilityFactory.getAbility(c.getSVar(t.getParam("Execute")), c);
String exec = c.getSVar(t.getParam("Execute"));
if (!exec.isEmpty()) {
SpellAbility trigSa = AbilityFactory.getAbility(exec, c);
if (trigSa != null && trigSa.getApi() == ApiType.LoseLife
&& trigSa.getParamOrDefault("Defined", "").contains("Opponent")) {
trigSa.setHostCard(c);
@@ -1392,6 +1394,7 @@ public class ComputerUtil {
}
}
}
}
}