Merge branch 'quick-fix-smart-card-art' into 'master'

BUG FIX for Smart Card Art selection

See merge request core-developers/forge!5329
This commit is contained in:
Michael Kamensky
2021-09-12 03:43:51 +00:00

View File

@@ -366,8 +366,8 @@ public class Deck extends DeckBase implements Iterable<Entry<DeckSection, CardPo
String setCode = alternativeCardPrint.getEdition(); String setCode = alternativeCardPrint.getEdition();
boolean isFoil = alternativeCardPrint.isFoil(); boolean isFoil = alternativeCardPrint.isFoil();
int cardsPerArtIndex = totalNrToAdd / nrOfAvailableArts; int cardsPerArtIndex = totalNrToAdd / nrOfAvailableArts;
int restOfCardsToAdd = cardsPerArtIndex > 0 ? totalNrToAdd % nrOfAvailableArts : 0;
cardsPerArtIndex = Math.max(1, cardsPerArtIndex); // make sure is never zero cardsPerArtIndex = Math.max(1, cardsPerArtIndex); // make sure is never zero
int restOfCardsToAdd = totalNrToAdd % nrOfAvailableArts;
int cardsAdded = 0; int cardsAdded = 0;
PaperCard alternativeCardArt = null; PaperCard alternativeCardArt = null;
for (int artIndex = 1; artIndex <= nrOfAvailableArts; artIndex++){ for (int artIndex = 1; artIndex <= nrOfAvailableArts; artIndex++){