mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- Fix an issue with the theme deck generator hanging on certain decks (-1 -1 BG Counters, Lands WRG)
This commit is contained in:
@@ -15,13 +15,10 @@ Treetop Village
|
|||||||
Dryad Arbor
|
Dryad Arbor
|
||||||
[/Group]
|
[/Group]
|
||||||
|
|
||||||
[Group MaxCnt=2 Percentage=5]
|
[Group MaxCnt=4 Percentage=5]
|
||||||
Kabira Crossroads
|
Kabira Crossroads
|
||||||
Karakas
|
Karakas
|
||||||
The Tabernacle at Pendrell Vale
|
The Tabernacle at Pendrell Vale
|
||||||
The Tabernacle at Pendrell Vale
|
|
||||||
The Tabernacle at Pendrell Vale
|
|
||||||
The Tabernacle at Pendrell Vale
|
|
||||||
[/Group]
|
[/Group]
|
||||||
|
|
||||||
[Group MaxCnt=4 Percentage=10]
|
[Group MaxCnt=4 Percentage=10]
|
||||||
|
|||||||
@@ -131,17 +131,16 @@ public class DeckGeneratorTheme extends DeckGeneratorBase {
|
|||||||
ss = s.split("\\|");
|
ss = s.split("\\|");
|
||||||
|
|
||||||
int lc = 0;
|
int lc = 0;
|
||||||
while ((cardCounts.get(ss[0]) >= g.maxCnt) || (lc > 999)) {
|
while ((cardCounts.get(ss[0]) >= g.maxCnt)) {
|
||||||
// looping
|
// looping
|
||||||
// forever
|
// forever
|
||||||
s = g.cardnames.get(MyRandom.getRandom().nextInt(cnSize));
|
s = g.cardnames.get(MyRandom.getRandom().nextInt(cnSize));
|
||||||
ss = s.split("\\|");
|
ss = s.split("\\|");
|
||||||
lc++;
|
|
||||||
}
|
|
||||||
if (lc > 999) {
|
if (lc > 999) {
|
||||||
throw new RuntimeException("ThemeDeckGenerator : getThemeDeck -- looped too much -- filename is "
|
throw new RuntimeException("ThemeDeckGenerator : getThemeDeck -- looped too much -- filename is "
|
||||||
+ tFileName);
|
+ tFileName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final int n = cardCounts.get(ss[0]);
|
final int n = cardCounts.get(ss[0]);
|
||||||
if (ss.length == 1) {
|
if (ss.length == 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user