mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Fixed the sideboarding code not allowing a deck with more cards than the original deck in Limited (Sealed, Draft) modes.
This commit is contained in:
@@ -145,7 +145,8 @@ public class PlayerControllerHuman extends PlayerController {
|
|||||||
JOptionPane.showMessageDialog(null, errMsg, "Invalid deck", JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(null, errMsg, "Invalid deck", JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
newMain = GuiChoose.sideboard(sideboard.toFlatList(), main.toFlatList());
|
boolean isLimited = (gameType == GameType.Draft || gameType == GameType.Sealed);
|
||||||
|
newMain = GuiChoose.sideboard(sideboard.toFlatList(), main.toFlatList(), isLimited);
|
||||||
}
|
}
|
||||||
|
|
||||||
newSb.clear();
|
newSb.clear();
|
||||||
|
|||||||
@@ -149,10 +149,10 @@ public class GuiChoose {
|
|||||||
return order(title, top, remainingObjects, sourceChoices, destChoices, referenceCard, false);
|
return order(title, top, remainingObjects, sourceChoices, destChoices, referenceCard, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T extends Comparable<? super T>> List<T> sideboard(List<T> sideboard, List<T> deck) {
|
public static <T extends Comparable<? super T>> List<T> sideboard(List<T> sideboard, List<T> deck, boolean isLimitedMode) {
|
||||||
Collections.sort(deck);
|
Collections.sort(deck);
|
||||||
Collections.sort(sideboard);
|
Collections.sort(sideboard);
|
||||||
return order("Sideboard", "Main Deck", sideboard.size(), sideboard, deck, null, true);
|
return order("Sideboard", "Main Deck", isLimitedMode ? -1 : sideboard.size(), sideboard, deck, null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user