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 @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
boolean sacrificed = false;
switch (sacrificingPlayer) { switch (sacrificingPlayer) {
case YOU: case YOU:
if (event.getPlayerId().equals(getControllerId())) { if (event.getPlayerId().equals(getControllerId())) {
return false; sacrificed = true;
} }
break; break;
case OPPONENT: case OPPONENT:
Player controller = game.getPlayer(getControllerId()); Player controller = game.getPlayer(getControllerId());
if (controller == null || !controller.hasOpponent(event.getPlayerId(), game)) { if (controller == null || !controller.hasOpponent(event.getPlayerId(), game)) {
return false; sacrificed = true;
} }
break; break;
} }
Permanent sacrificedPermanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); 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 @Override