From e182a87615f41604336ccf3c17cad5e97e3710da Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Sat, 5 Aug 2023 12:54:37 -0500 Subject: [PATCH] Fixing foil versions of aliased cards not being usable in limited formats. Fixed sealed collection double-counting. --- .../lotro/game/formats/DefaultLotroFormat.java | 7 ++++--- .../java/com/gempukku/lotro/hall/HallServer.java | 15 +++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java index 609fb374a..294743d57 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java @@ -488,13 +488,14 @@ public class DefaultLotroFormat implements LotroFormat { public String applyErrata(String original) { var base = _library.getBaseBlueprintId(original); var errata = _errataCardMap.getOrDefault(base, base); - if (original.endsWith("*") && !errata.endsWith("*")) { - errata += "*"; - } if(errata.equals(base)) return original; + if (original.endsWith("*") && !errata.endsWith("*")) { + errata += "*"; + } + return errata; } diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java index ed5d331ad..32dd0ceed 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java @@ -704,8 +704,15 @@ public class HallServer extends AbstractServer { Map deckCardCounts = CollectionUtils.getTotalCardCountForDeck(lotroDeck); for (Map.Entry cardCount : deckCardCounts.entrySet()) { - int collectionCount = collection.getItemCount(cardCount.getKey()) + - collection.getItemCount(format.applyErrata(cardCount.getKey())); + String overtID = cardCount.getKey(); + String errataID = format.applyErrata(cardCount.getKey()); + var baseIDs = format.findBaseCards(cardCount.getKey()); + + int collectionCount = collection.getItemCount(cardCount.getKey()); + + if(!errataID.equals(overtID)) { + collection.getItemCount(errataID); + } var alts = _library.getAllAlternates(cardCount.getKey()); if(alts != null) { @@ -714,10 +721,6 @@ public class HallServer extends AbstractServer { } } -// for(String id : format.findBaseCards(cardCount.getKey())) { -// collectionCount += collection.getItemCount(id); -// } - if (collectionCount < cardCount.getValue()) { String cardName = null; try {