From c6e520d5fa605cfdb9020b32063bd6cbb4db9c9e Mon Sep 17 00:00:00 2001 From: Sloth Date: Mon, 16 Apr 2012 15:04:23 +0000 Subject: [PATCH] - Fixed singleton mode freezing. --- .../java/forge/deck/generate/GenerateColoredDeckBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java b/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java index 07190edb9c4..a27e9cce549 100644 --- a/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java +++ b/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java @@ -82,7 +82,7 @@ public abstract class GenerateColoredDeckBase { do { c = source.get(this.r.nextInt(source.size())); 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) { throw new RuntimeException("Generate2ColorDeck : get2ColorDeck -- looped too much -- Cr12"); @@ -103,7 +103,7 @@ public abstract class GenerateColoredDeckBase { do { s = source.get(this.r.nextInt(source.size())); 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. tDeck.add(CardDb.instance().getCard(s));