- Fixed singleton mode freezing.

This commit is contained in:
Sloth
2012-04-16 15:04:23 +00:00
parent 6fa076abe6
commit c6e520d5fa

View File

@@ -82,7 +82,7 @@ public abstract class GenerateColoredDeckBase {
do { do {
c = source.get(this.r.nextInt(source.size())); c = source.get(this.r.nextInt(source.size()));
lc++; lc++;
} while ((this.cardCounts.get(c.getName()) > (this.maxDuplicates - 1)) || (lc > 100)); } while ((this.cardCounts.get(c.getName()) > (this.maxDuplicates - 1)) && (lc <= 100));
if (lc > 100) { if (lc > 100) {
throw new RuntimeException("Generate2ColorDeck : get2ColorDeck -- looped too much -- Cr12"); throw new RuntimeException("Generate2ColorDeck : get2ColorDeck -- looped too much -- Cr12");
@@ -103,7 +103,7 @@ public abstract class GenerateColoredDeckBase {
do { do {
s = source.get(this.r.nextInt(source.size())); s = source.get(this.r.nextInt(source.size()));
lc++; lc++;
} while ((this.cardCounts.get(s) > (this.maxDuplicates - 1)) || (lc > 20)); } while ((this.cardCounts.get(s) > 3) && (lc <= 20));
// not an error if looped too much - could play singleton mode, with 6 slots for 3 non-basic lands. // not an error if looped too much - could play singleton mode, with 6 slots for 3 non-basic lands.
tDeck.add(CardDb.instance().getCard(s)); tDeck.add(CardDb.instance().getCard(s));