mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Fix duplicating cards in quest mode
This commit is contained in:
@@ -91,8 +91,10 @@ public class DeckController<T extends DeckBase> {
|
|||||||
}
|
}
|
||||||
public void loadDeck(Deck deck, boolean substituteCurrentDeck) {
|
public void loadDeck(Deck deck, boolean substituteCurrentDeck) {
|
||||||
boolean isStored;
|
boolean isStored;
|
||||||
if (view.getCatalogManager().isInfinite()) {
|
boolean isInfinite = view.getCatalogManager().isInfinite();
|
||||||
Deck currentDeck = view.getHumanDeck();
|
Deck currentDeck = view.getHumanDeck();
|
||||||
|
|
||||||
|
if (isInfinite) {
|
||||||
if (substituteCurrentDeck || currentDeck.isEmpty()) {
|
if (substituteCurrentDeck || currentDeck.isEmpty()) {
|
||||||
newModel();
|
newModel();
|
||||||
isStored = false;
|
isStored = false;
|
||||||
@@ -107,10 +109,12 @@ public class DeckController<T extends DeckBase> {
|
|||||||
isStored = false;
|
isStored = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Deck currentDeck = view.getHumanDeck();
|
|
||||||
for (DeckSection section: EnumSet.allOf(DeckSection.class)) {
|
for (DeckSection section: EnumSet.allOf(DeckSection.class)) {
|
||||||
if (view.isSectionImportable(section)) {
|
if (view.isSectionImportable(section)) {
|
||||||
CardPool sectionCards = currentDeck.getOrCreate(section);
|
CardPool sectionCards = currentDeck.getOrCreate(section);
|
||||||
|
if (!isInfinite) {
|
||||||
|
sectionCards.clear();
|
||||||
|
}
|
||||||
sectionCards.addAll(deck.getOrCreate(section));
|
sectionCards.addAll(deck.getOrCreate(section));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user