From 36ebe56b7f8a984f42c41b0170ce5127b3351cfe Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 14 Jun 2014 12:23:02 +0200 Subject: [PATCH] * Undo of mana abilities - Fixed a problem that caused that undo was not done properly (e.g. filterlands (Flooded Grove), Nykthos, Shrine to Nyx, Grinning Ignus, Oppressive Rays, Propaganda). --- Mage/src/mage/players/PlayerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index d8c2f91ade..0e678e5b36 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -792,7 +792,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (ability.activate(game, false)) { ability.resolve(game); // #169 - if (storedBookmark == -1) { + if (storedBookmark == -1 || storedBookmark > bookmark) { // e.g. userfull for undo Nykthos, Shrine to Nyx setStoredBookmark(bookmark); } //game.removeBookmark(bookmark); @@ -1651,6 +1651,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public void declareAttacker(UUID attackerId, UUID defenderId, Game game) { + setStoredBookmark(game.bookmarkState()); // makes it possible to UNDO a declared attacker with costs from e.g. Propaganda Permanent attacker = game.getPermanent(attackerId); if (attacker != null && attacker.canAttack(game) && attacker.getControllerId().equals(playerId)) { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, attackerId, playerId))) {