mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
Test and fix for Issue#42: Creature with undying didn't forget -1/-1 after dying and returning from graveyard
This commit is contained in:
parent
9d99029c75
commit
7d9b338328
4 changed files with 35 additions and 0 deletions
|
|
@ -29,6 +29,7 @@
|
|||
package mage.game.permanent;
|
||||
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.LevelerCard;
|
||||
import mage.game.Game;
|
||||
|
|
@ -172,6 +173,13 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
|||
if (controller != null && controller.removeFromBattlefield(this, game)) {
|
||||
ZoneChangeEvent event = new ZoneChangeEvent(this, sourceId, controllerId, fromZone, toZone);
|
||||
if (!game.replaceEvent(event)) {
|
||||
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
|
||||
for (ContinuousEffect effect : game.getContinuousEffects().getLayeredEffects(game)) {
|
||||
if (effect.getAffectedObjects().contains(getId())) {
|
||||
effect.getAffectedObjects().remove(getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
Player owner = game.getPlayer(ownerId);
|
||||
game.rememberLKI(objectId, Zone.BATTLEFIELD, this);
|
||||
if (owner != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue