This commit is contained in:
tool4EvEr
2022-10-29 12:47:16 +02:00
parent b926401f3d
commit 93bcfaaf7c
6 changed files with 5 additions and 22 deletions

View File

@@ -1317,22 +1317,6 @@ public class AbilityUtils {
final Object o = root.getTriggeringObject(AbilityKey.fromString(triggeringType));
if (o instanceof SpellAbility) {
s = (SpellAbility) o;
// if there is no target information in SA but targets are listed in SpellAbilityTargeting cards, copy that
// information so it's not lost if the calling code is interested in targets of the triggered SA.
if (triggeringType.equals("SpellAbility")) {
final List<GameEntity> tgtList = (List<GameEntity>) root.getTriggeringObject(AbilityKey.SpellAbilityTargets);
if (s.getTargets() != null && s.getTargets().size() == 0) {
if (tgtList != null && tgtList.size() > 0) {
TargetChoices tc = new TargetChoices();
for (GameEntity ge : tgtList) {
if (ge instanceof Card) {
tc.add((Card) ge);
}
}
s.setTargets(tc);
}
}
}
} else if (o instanceof SpellAbilityStackInstance) {
s = ((SpellAbilityStackInstance) o).getSpellAbility(true);
}

View File

@@ -561,7 +561,7 @@ public class TriggerHandler {
sa.setTriggerRemembered(regtrig.getTriggerRemembered());
if (regtrig.hasParam("TriggerController")) {
Player p = AbilityUtils.getDefinedPlayers(regtrig.getHostCard(), regtrig.getParam("TriggerController"), sa).get(0);
Player p = AbilityUtils.getDefinedPlayers(host, regtrig.getParam("TriggerController"), sa).get(0);
sa.setActivatingPlayer(p);
}