Can't be target/attached effects - fixed that user gets multiple warning message about prevention effect;

This commit is contained in:
Oleg Agafonov 2020-01-28 05:31:32 +04:00
parent 105062beb7
commit 8ca6fd8552
18 changed files with 91 additions and 114 deletions

View file

@ -1971,12 +1971,12 @@ public abstract class GameImpl implements Game, Serializable {
Filter auraFilter = spellAbility.getTargets().get(0).getFilter();
if (auraFilter instanceof FilterControlledPermanent) {
if (!((FilterControlledPermanent) auraFilter).match(attachedTo, perm.getId(), perm.getControllerId(), this)
|| attachedTo.cantBeAttachedBy(perm, this)) {
|| attachedTo.cantBeAttachedBy(perm, this, true)) {
if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true;
}
}
} else if (!auraFilter.match(attachedTo, this) || attachedTo.cantBeAttachedBy(perm, this)) {
} else if (!auraFilter.match(attachedTo, this) || attachedTo.cantBeAttachedBy(perm, this, true)) {
// handle bestow unattachment
Card card = this.getCard(perm.getId());
if (card != null && card.isCreature()) {