mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Fixed singleton mode freezing.
This commit is contained in:
@@ -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));
|
||||||
|
|||||||
Reference in New Issue
Block a user