From 10b7791cd22877f7b22fe8375cfff16c861a8e55 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 20 Mar 2015 17:30:12 +0100 Subject: [PATCH] * Tiny Leaders Format - Fixed a bug that happened as you did not set the Leader name to the deck name. --- .../src/mage/deck/TinyLeaders.java | 9 ++++++++- Mage/src/mage/game/GameTinyLeadersImpl.java | 20 ++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) 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 d663d36333..45e68e207a 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,14 @@ 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 name in the NAME field in the DECK EDITOR (use the Sultai for a UBG (2/2) default Commander)"); + if (deck.getName() == null) { + invalid.put("Leader", "You have to save your deck with the leader card name entered to the DECK NAME field of the DECK EDITOR (top left) so that XMage knows your leader." + + "(You can use the \"Sultai\" for a UBG (2/2) default Commander.)"); + } else { + invalid.put("Leader", "Leader [" + deck.getName() + "] not found. You have to enter the name of the leader card into the DECK NAME field of the DECK EDITOR (top left). Check your spelling " + + "(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/src/mage/game/GameTinyLeadersImpl.java b/Mage/src/mage/game/GameTinyLeadersImpl.java index 063d38b8a8..57f886fa72 100644 --- a/Mage/src/mage/game/GameTinyLeadersImpl.java +++ b/Mage/src/mage/game/GameTinyLeadersImpl.java @@ -121,15 +121,17 @@ public abstract class GameTinyLeadersImpl extends GameImpl{ */ public static Card getCommanderCard(String commanderName, UUID ownerId) { Card commander = null; - switch (commanderName) { - case "Sultai": - commander = new DefaultCommander(ownerId, commanderName, "{U}{B}{G}"); - break; - default: - CardInfo cardInfo = CardRepository.instance.findCard(commanderName); - if (cardInfo != null) { - commander = cardInfo.getCard(); - } + if (commanderName != null) { + switch (commanderName) { + case "Sultai": + commander = new DefaultCommander(ownerId, commanderName, "{U}{B}{G}"); + break; + default: + CardInfo cardInfo = CardRepository.instance.findCard(commanderName); + if (cardInfo != null) { + commander = cardInfo.getCard(); + } + } } return commander; }