- Fix an issue with the theme deck generator hanging on certain decks (-1 -1 BG Counters, Lands WRG)

This commit is contained in:
Agetian
2019-06-20 19:30:36 +03:00
committed by churrufli
parent ac333e7425
commit a677ef2b9a
2 changed files with 6 additions and 10 deletions

View File

@@ -15,13 +15,10 @@ Treetop Village
Dryad Arbor
[/Group]
[Group MaxCnt=2 Percentage=5]
[Group MaxCnt=4 Percentage=5]
Kabira Crossroads
Karakas
The Tabernacle at Pendrell Vale
The Tabernacle at Pendrell Vale
The Tabernacle at Pendrell Vale
The Tabernacle at Pendrell Vale
[/Group]
[Group MaxCnt=4 Percentage=10]

View File

@@ -131,16 +131,15 @@ public class DeckGeneratorTheme extends DeckGeneratorBase {
ss = s.split("\\|");
int lc = 0;
while ((cardCounts.get(ss[0]) >= g.maxCnt) || (lc > 999)) {
while ((cardCounts.get(ss[0]) >= g.maxCnt)) {
// looping
// forever
s = g.cardnames.get(MyRandom.getRandom().nextInt(cnSize));
ss = s.split("\\|");
lc++;
}
if (lc > 999) {
throw new RuntimeException("ThemeDeckGenerator : getThemeDeck -- looped too much -- filename is "
+ tFileName);
if (lc > 999) {
throw new RuntimeException("ThemeDeckGenerator : getThemeDeck -- looped too much -- filename is "
+ tFileName);
}
}
final int n = cardCounts.get(ss[0]);