Fixed Banishing Light-type effects to not exile creatures if the source permanent is not on the battlefield when the effect resolves. Closes #8899.

This commit is contained in:
Alex Vasile 2022-07-17 21:08:09 -04:00
parent 9715021a35
commit 513085bbcc
2 changed files with 18 additions and 7 deletions

View file

@ -87,6 +87,11 @@ class LagrellaTheMagpieEffect extends OneShotEffect {
if (player == null) {
return false;
}
// Like other Banishing Light effects, no permanents get exiled if Lagrella is not in the battlefield when this ability resolves.
if (game.getPermanent(source.getSourceId()) == null) {
return false;
}
Cards cards = new CardsImpl();
this.getTargetPointer()
.getTargets(game, source)

View file

@ -30,13 +30,19 @@ public class ExileUntilSourceLeavesEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
ExileTargetEffect effect = new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName());
if (targetPointer != null) { // Grasping Giant
effect.setTargetPointer(targetPointer);
}
return effect.apply(game, source);
if (permanent == null) {
return false;
}
return false;
// If Banishing Light leaves the battlefield before its triggered ability resolves, the target permanent won't be exiled.
// (2021-03-19)
if (game.getPermanent(source.getSourceId()) == null) {
return false;
}
ExileTargetEffect effect = new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName());
if (targetPointer != null) { // Grasping Giant
effect.setTargetPointer(targetPointer);
}
return effect.apply(game, source);
}
}