fixed Nivmagus Elemental being able to infinitely exile copied spells (fixes #4092)

This commit is contained in:
Evan Kranzler 2017-10-10 16:23:03 -04:00
parent bef2137443
commit 80f21132eb
2 changed files with 12 additions and 8 deletions

View file

@ -61,10 +61,15 @@ public class ExileFromStackCost extends CostImpl {
if (spellToExile == null) {
return false;
}
spellToExile.moveToExile(null, "", ability.getSourceId(), game);
String spellName = spellToExile.getName();
if (spellToExile.isCopy()) {
game.getStack().remove(spellToExile);
} else {
spellToExile.moveToExile(null, "", ability.getSourceId(), game);
}
paid = true;
if (!game.isSimulation()) {
game.informPlayers(player.getLogName() + " exiles " + spellToExile.getName() + " (as costs)");
game.informPlayers(player.getLogName() + " exiles " + spellName + " (as costs)");
}
}
}