mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
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:
parent
9715021a35
commit
513085bbcc
2 changed files with 18 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue