- Only write out the card art index to the deck if the art count for the card is greater than 1.

This commit is contained in:
Agetian
2014-01-14 15:42:47 +00:00
parent d65b645a64
commit eb4a355dc7
2 changed files with 11 additions and 2 deletions

View File

@@ -277,7 +277,7 @@ public final class CardDb implements ICardDatabase {
Collection<PaperCard> cards = allCardsByName.get(cardName);
if ( null == cards ) {
throw new NoSuchElementException(String.format("Card '%s' not found in our database.", cardName));
return 0;
}
for ( PaperCard pc : cards ) {

View File

@@ -32,6 +32,7 @@ import org.apache.commons.lang3.StringUtils;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import forge.StaticData;
import forge.card.CardDb;
import forge.card.ColorSet;
@@ -223,9 +224,17 @@ public class Deck extends DeckBase implements Iterable<Entry<DeckSection, CardPo
sb.append(n).append(" ").append(card.getName());
if (!hasBadSetInfo) {
int artCount = StaticData.instance().getCommonCards().getArtCount(card.getName(), card.getEdition());
if (artCount < 1) {
artCount = StaticData.instance().getVariantCards().getArtCount(card.getName(), card.getEdition());
}
sb.append("|").append(card.getEdition());
if (artCount > 1) {
sb.append("|").append(card.getArtIndex());
}
}
if(card.isFoil()) {
sb.append(CardDb.foilSuffix);
}