mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
* 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).
This commit is contained in:
parent
683175aed8
commit
36ebe56b7f
1 changed files with 2 additions and 1 deletions
|
@ -792,7 +792,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
if (ability.activate(game, false)) {
|
if (ability.activate(game, false)) {
|
||||||
ability.resolve(game);
|
ability.resolve(game);
|
||||||
// #169
|
// #169
|
||||||
if (storedBookmark == -1) {
|
if (storedBookmark == -1 || storedBookmark > bookmark) { // e.g. userfull for undo Nykthos, Shrine to Nyx
|
||||||
setStoredBookmark(bookmark);
|
setStoredBookmark(bookmark);
|
||||||
}
|
}
|
||||||
//game.removeBookmark(bookmark);
|
//game.removeBookmark(bookmark);
|
||||||
|
@ -1651,6 +1651,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void declareAttacker(UUID attackerId, UUID defenderId, Game game) {
|
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);
|
Permanent attacker = game.getPermanent(attackerId);
|
||||||
if (attacker != null && attacker.canAttack(game) && attacker.getControllerId().equals(playerId)) {
|
if (attacker != null && attacker.canAttack(game) && attacker.getControllerId().equals(playerId)) {
|
||||||
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, attackerId, playerId))) {
|
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, attackerId, playerId))) {
|
||||||
|
|
Loading…
Reference in a new issue