SacrificeAllTriggeredAbility bug fix. fixes #1736

This commit is contained in:
drmDev 2016-07-11 22:04:34 -04:00
parent 91f74ced1f
commit 7261452413

View file

@ -48,21 +48,22 @@ public class SacrificeAllTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
boolean sacrificed = false;
switch (sacrificingPlayer) {
case YOU:
if (event.getPlayerId().equals(getControllerId())) {
return false;
sacrificed = true;
}
break;
case OPPONENT:
Player controller = game.getPlayer(getControllerId());
if (controller == null || !controller.hasOpponent(event.getPlayerId(), game)) {
return false;
sacrificed = true;
}
break;
}
Permanent sacrificedPermanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
return sacrificedPermanent != null && filter.match(sacrificedPermanent, getSourceId(), getControllerId(), game);
return sacrificed && sacrificedPermanent != null && filter.match(sacrificedPermanent, getSourceId(), getControllerId(), game);
}
@Override