fix copy effect not being discarded early enough (#12434)

This commit is contained in:
Susucre 2024-06-08 20:49:20 +02:00 committed by GitHub
parent 4931cbfd50
commit e2066f41ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 3 deletions

View file

@ -81,8 +81,12 @@ public class CopyEffect extends ContinuousEffectImpl {
}
Permanent permanent = affectedObjectList.get(0).getPermanent(game);
if (permanent == null) {
if (!game.getShortLivingLKI(getSourceId(), Zone.BATTLEFIELD)) {
discard();
return false;
}
// As long as the permanent is still in the short living LKI continue to copy to get triggered abilities to TriggeredAbilities for dies events.
permanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, source.getSourceObjectZoneChangeCounter());
// As long as the permanent is still in the LKI continue to copy to get triggered abilities to TriggeredAbilities for dies events.
if (permanent == null) {
discard();
return false;