From 72b0192bae4d5ce661c47945410f441db7c1152c Mon Sep 17 00:00:00 2001 From: spjspj Date: Fri, 7 Oct 2016 10:38:56 +1100 Subject: [PATCH] spjspj - Fix cube from deck from being broken with layouts --- .../main/java/mage/client/dialog/NewTournamentDialog.java | 3 ++- Mage/src/main/java/mage/cards/decks/Deck.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java index 90cc1b2bd3..c07368669b 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -585,7 +585,8 @@ public class NewTournamentDialog extends MageDialog { } catch (GameException e1) { JOptionPane.showMessageDialog(MageFrame.getDesktop(), e1.getMessage(), "Error loading deck", JOptionPane.ERROR_MESSAGE); } - if (cubeFromDeck != null) { + if (cubeFromDeck != null) { + cubeFromDeck.clearLayouts(); tOptions.getLimitedOptions().setCubeFromDeck(cubeFromDeck); } } diff --git a/Mage/src/main/java/mage/cards/decks/Deck.java b/Mage/src/main/java/mage/cards/decks/Deck.java index 3ee7dfd194..b3d7abc1fc 100644 --- a/Mage/src/main/java/mage/cards/decks/Deck.java +++ b/Mage/src/main/java/mage/cards/decks/Deck.java @@ -164,5 +164,10 @@ public class Deck implements Serializable { public void setDeckHashCode(long deckHashCode) { this.deckHashCode = deckHashCode; } + + public void clearLayouts() { + this.cardsLayout = null; + this.sideboardLayout = null; + } }