Properly fix targeting.

The notTarget should only invalidate the canBeTargetedBy return.
The Filter should still be relevant.
This commit is contained in:
Nathaniel Brandes 2017-03-08 20:59:01 -08:00
parent 495e20ae1a
commit 4a9eddb724

View file

@ -135,12 +135,12 @@ public class TargetDefender extends TargetImpl {
MageObject targetSource = game.getObject(sourceId);
for (UUID playerId: game.getState().getPlayersInRange(sourceControllerId, game)) {
Player player = game.getPlayer(playerId);
if (notTarget || (player != null && player.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(player, game))) {
if (player != null && (player.canBeTargetedBy(targetSource, sourceControllerId, game) || notTarget) && filter.match(player, game)) {
possibleTargets.add(playerId);
}
}
for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
if (notTarget || (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game))) {
if ((permanent.canBeTargetedBy(targetSource, sourceControllerId, game) || notTarget) && filter.match(permanent, game)) {
possibleTargets.add(permanent.getId());
}
}