mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
[EMN] Fix filter by name in the MeldCondition.
This commit is contained in:
parent
99a2f4b323
commit
c334d98564
1 changed files with 3 additions and 1 deletions
|
@ -31,6 +31,7 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
@ -54,7 +55,8 @@ public class MeldCondition implements Condition {
|
|||
Permanent sourcePermanent = (Permanent) sourceMageObject;
|
||||
if (sourcePermanent.getControllerId().equals(source.getControllerId())
|
||||
&& sourcePermanent.getOwnerId().equals(source.getControllerId())) {
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(this.meldWithName);
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
filter.add(new NamePredicate(this.meldWithName));
|
||||
for (Permanent meldWithPermanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (meldWithPermanent.getOwnerId().equals(source.getControllerId())) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue