* Mirrorwing Dragon - Fixed wrong target handling.

This commit is contained in:
LevelX2 2016-07-15 18:14:38 +02:00
parent 4302186032
commit e5117a967d
2 changed files with 6 additions and 1 deletions

View file

@ -108,7 +108,9 @@ class MirrorwingDragonCopyTriggeredAbility extends TriggeredAbilityImpl {
private boolean checkSpell(Spell spell, Game game) {
if (spell != null
&& (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) {
boolean noTargets = true;
for (TargetAddress addr : TargetAddress.walk(spell)) {
noTargets = false;
Target targetInstance = addr.getTarget(spell);
for (UUID target : targetInstance.getTargets()) {
Permanent permanent = game.getPermanent(target);
@ -117,6 +119,9 @@ class MirrorwingDragonCopyTriggeredAbility extends TriggeredAbilityImpl {
}
}
}
if (noTargets) {
return false;
}
getEffects().get(0).setValue("triggeringSpell", spell);
return true;
}

View file

@ -122,7 +122,7 @@ public abstract class CopySpellForEachItCouldTargetEffect<T extends MageItem> ex
copy = spell.copySpell(source.getControllerId());
try {
modifyCopy(copy, (T) obj, game, source);
if (!filter.match((T) obj, game)) {
if (!filter.match((T) obj, source.getSourceId(), actingPlayer.getId(), game)) {
continue;
}
} catch (ClassCastException e) {