Remove redundant branch in TargetPermanent canTarget method
@@ -57,7 +57,10 @@ public class TargetPermanent extends TargetObject {
@Override
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
Permanent permanent = game.getPermanent(id);
- if (permanent != null) {
+ if (permanent == null) {
+ return false;
+ }
+
if (source != null) {
//1. TODO: check for replacement effects
//2. We need to check both source.getId() and source.getSourceId()
@@ -69,12 +72,9 @@ public class TargetPermanent extends TargetObject {
return false;
}
}
- return filter.match(permanent, controllerId, source, game);
- } else {
- return filter.match(permanent, controllerId, source, game);
}
- }
- return false;
+
+ return filter.match(permanent, controllerId, source, game);
}
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game, boolean flag) {
