* Tiny Leaders Format - Fixed a bug that happened as you did not set the Leader name to the deck name.

This commit is contained in:
LevelX2 2015-03-20 17:30:12 +01:00
parent d80ba99af9
commit 10b7791cd2
2 changed files with 19 additions and 10 deletions

View file

@ -151,7 +151,14 @@ public class TinyLeaders extends DeckValidator {
if (commander == null || commander.getManaCost().convertedManaCost() > 3) { if (commander == null || commander.getManaCost().convertedManaCost() > 3) {
if (commander == null) { 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) { if (commander != null && commander.getManaCost().convertedManaCost() > 3) {
invalid.put("Leader", "Commanders converted mana cost is greater than 3"); invalid.put("Leader", "Commanders converted mana cost is greater than 3");

View file

@ -121,15 +121,17 @@ public abstract class GameTinyLeadersImpl extends GameImpl{
*/ */
public static Card getCommanderCard(String commanderName, UUID ownerId) { public static Card getCommanderCard(String commanderName, UUID ownerId) {
Card commander = null; Card commander = null;
switch (commanderName) { if (commanderName != null) {
case "Sultai": switch (commanderName) {
commander = new DefaultCommander(ownerId, commanderName, "{U}{B}{G}"); case "Sultai":
break; commander = new DefaultCommander(ownerId, commanderName, "{U}{B}{G}");
default: break;
CardInfo cardInfo = CardRepository.instance.findCard(commanderName); default:
if (cardInfo != null) { CardInfo cardInfo = CardRepository.instance.findCard(commanderName);
commander = cardInfo.getCard(); if (cardInfo != null) {
} commander = cardInfo.getCard();
}
}
} }
return commander; return commander;
} }