From e23fe7016d15600609b3aa13289ce92c81e157f5 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Mon, 28 Dec 2020 05:58:19 +0400 Subject: [PATCH] * Naked Singularity, Reality Twist - fixed rollback error on disconnect while choosing mana color (#7296); --- Mage.Sets/src/mage/cards/n/NakedSingularity.java | 15 +++++++-------- Mage.Sets/src/mage/cards/r/RealityTwist.java | 12 ++++++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Mage.Sets/src/mage/cards/n/NakedSingularity.java b/Mage.Sets/src/mage/cards/n/NakedSingularity.java index 6515348f607..930174877b2 100644 --- a/Mage.Sets/src/mage/cards/n/NakedSingularity.java +++ b/Mage.Sets/src/mage/cards/n/NakedSingularity.java @@ -1,7 +1,5 @@ - package mage.cards.n; -import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -19,8 +17,9 @@ import mage.game.events.ManaEvent; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** - * * @author emerald000 */ public final class NakedSingularity extends CardImpl { @@ -93,11 +92,11 @@ class NakedSingularityEffect extends ReplacementEffectImpl { if (choice.getChoices().size() == 1) { chosenColor = choice.getChoices().iterator().next(); } else { - if (controller.choose(Outcome.PutManaInPool, choice, game)) { - chosenColor = choice.getChoice(); - } else { - return false; - } + controller.choose(Outcome.PutManaInPool, choice, game); + chosenColor = choice.getChoice(); + } + if (chosenColor == null) { + return false; } ManaEvent manaEvent = (ManaEvent) event; Mana mana = manaEvent.getMana(); diff --git a/Mage.Sets/src/mage/cards/r/RealityTwist.java b/Mage.Sets/src/mage/cards/r/RealityTwist.java index 33c7a053dde..950718f82fe 100644 --- a/Mage.Sets/src/mage/cards/r/RealityTwist.java +++ b/Mage.Sets/src/mage/cards/r/RealityTwist.java @@ -1,7 +1,5 @@ - package mage.cards.r; -import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -19,8 +17,9 @@ import mage.game.events.ManaEvent; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** - * * @author emerald000 & L_J */ public final class RealityTwist extends CardImpl { @@ -90,11 +89,12 @@ class RealityTwistEffect extends ReplacementEffectImpl { if (choice.getChoices().size() == 1) { chosenColor = choice.getChoices().iterator().next(); } else { - if (!controller.choose(Outcome.PutManaInPool, choice, game)) { - return false; - } + controller.choose(Outcome.PutManaInPool, choice, game); chosenColor = choice.getChoice(); } + if (chosenColor == null) { + return false; + } ManaEvent manaEvent = (ManaEvent) event; Mana mana = manaEvent.getMana(); int amount = mana.count();