From 78df43fd30850568c6494fb12c1f9d8415ef850f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 19 Mar 2015 00:54:04 +0100 Subject: [PATCH] Fixed a sideboarding bug of Tiny Leaders Format (fixes #807). --- .../Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java | 2 +- Mage.Server/src/main/java/mage/server/TableController.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java index 471ccaedf2..d663d36333 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java @@ -151,7 +151,7 @@ public class TinyLeaders extends DeckValidator { if (commander == null || commander.getManaCost().convertedManaCost() > 3) { if (commander == null) { - invalid.put("Leader", "Please be sure to set your leader in the NAME field in the DECK EDITOR (use the names Mardu, Sultai or Jeskai as default Commanders)"); + invalid.put("Leader", "Please be sure to set your leader name in the NAME field in the DECK EDITOR (use the Sultai for a UBG (2/2) default Commander)"); } if (commander != null && commander.getManaCost().convertedManaCost() > 3) { invalid.put("Leader", "Commanders converted mana cost is greater than 3"); diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index f2a236d52f..f26ac452da 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -349,6 +349,12 @@ public class TableController { return false; } Deck deck = Deck.load(deckList, false, false); + if (table.getState() == TableState.SIDEBOARDING && table.getMatch() != null) { + MatchPlayer mPlayer = table.getMatch().getPlayer(playerId); + if (mPlayer != null) { + deck.setName(mPlayer.getDeck().getName()); + } + } if (!Main.isTestMode() && !table.getValidator().validate(deck)) { throw new InvalidDeckException("Invalid deck for this format", table.getValidator().getInvalid()); }