* Hindering Light - Fixed that target check did not work correctly for modal spells (e.g. Cryptic Command).

This commit is contained in:
LevelX2 2015-05-23 16:59:53 +02:00
parent 50e8e3930c
commit d427e9a315

View file

@ -84,17 +84,19 @@ class HinderingLightPredicate implements ObjectPlayerPredicate<ObjectPlayer<Stac
if (controllerId == null) {
return false;
}
for (Target target : input.getObject().getStackAbility().getTargets()) {
for (UUID targetId : target.getTargets()) {
if (controllerId.equals(targetId)) {
return true;
for (UUID modeId :input.getObject().getStackAbility().getModes().getSelectedModes()) {
input.getObject().getStackAbility().getModes().setActiveMode(modeId);
for (Target target : input.getObject().getStackAbility().getTargets()) {
for (UUID targetId : target.getTargets()) {
if (controllerId.equals(targetId)) {
return true;
}
Permanent permanent = game.getPermanent(targetId);
if (permanent != null && controllerId.equals(permanent.getControllerId())) {
return true;
}
}
Permanent permanent = game.getPermanent(targetId);
if (permanent != null && controllerId.equals(permanent.getControllerId())) {
return true;
}
}
}
}
return false;
}