Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions forge-core/src/main/java/forge/card/CardDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,13 +672,29 @@ private PaperCard tryGetCard(CardRequest request) {
CardEdition edition = editions.get(reqEditionCode.toUpperCase());

PaperCard cardFromSet = this.getCardFromSet(request.cardName, edition, request.artIndex, request.collectorNumber, request.isFoil);
if(cardFromSet != null && request.flags != null)
if (cardFromSet != null && request.flags != null) {
cardFromSet = cardFromSet.copyWithFlags(request.flags);
}

if (cardFromSet != null)
if (cardFromSet != null) {
return cardFromSet;
}

if (request.artIndex > 0
|| (request.collectorNumber != null && !request.collectorNumber.isEmpty() && !request.collectorNumber.equals(IPaperCard.NO_COLLECTOR_NUMBER))) {
// If request failed, try again without artIndex and collectorNumber to attempt to find from same set first
cardFromSet = this.getCardFromSet(request.cardName, edition, -1, IPaperCard.NO_COLLECTOR_NUMBER, request.isFoil);
if(cardFromSet != null && request.flags != null)
cardFromSet = cardFromSet.copyWithFlags(request.flags);

if (cardFromSet != null) {
return cardFromSet;
}
}

}


// 2. Card lookup in edition with specified filter didn't work.
// So now check whether the cards exist in the DB first,
// and select pick the card based on current SetPreference policy as a fallback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Set=40K
1 Mandate of Abaddon|40K|1
1 Molten Slagheap|40K|1
1 Mortarion, Daemon Primarch|40K|1
8 Mountain|40K|3
8 Mountain|40K|2
1 Mutalith Vortex Beast|40K|1
1 Noise Marine|40K|1
1 Nurgle's Conscription|40K|1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Set=40K
1 Mandate of Abaddon|40K|1
1 Molten Slagheap|40K|1
1 Mortarion, Daemon Primarch|40K|1
8 Mountain|40K|3
8 Mountain|40K|2
1 Mutalith Vortex Beast|40K|1
1 Noise Marine|40K|1
1 Nurgle's Conscription|40K|1
Expand Down