mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Fixed Protection from artifacts not working for Equip ability being able to equip.
This commit is contained in:
parent
d19c7927e4
commit
d387d5afa2
1 changed files with 7 additions and 2 deletions
|
@ -81,8 +81,13 @@ public class TargetPermanent<T extends TargetPermanent<T>> extends TargetObject<
|
|||
Permanent permanent = game.getPermanent(id);
|
||||
if (permanent != null) {
|
||||
if (source != null)
|
||||
//TODO: check for replacement effects
|
||||
return permanent.canBeTargetedBy(game.getObject(source.getId())) && filter.match(permanent, source.getSourceId(), controllerId, game);
|
||||
//1. TODO: check for replacement effects
|
||||
//2. We need to check both source.getId() and source.getSourceId()
|
||||
// first for protection from spells or abilities (e.g. protection from colored spells, r1753)
|
||||
// second for protection from sources (e.g. protection from artifacts + equip ability)
|
||||
return permanent.canBeTargetedBy(game.getObject(source.getId()))
|
||||
&& permanent.canBeTargetedBy(game.getObject(source.getSourceId()))
|
||||
&& filter.match(permanent, source.getSourceId(), controllerId, game);
|
||||
else
|
||||
return filter.match(permanent, null, controllerId, game);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue