[DeckListModel] Fix exception precedence in legality check

This commit is contained in:
RickyRister 2026-01-18 23:20:24 -08:00
parent af2995ba96
commit 35d14d3cf7

View file

@ -709,8 +709,9 @@ static bool isCardQuantityLegalForFormat(const QString &format, const CardInfo &
auto formatRules = CardDatabaseManager::query()->getFormat(format);
// if format has no custom rules, then just do the default check
if (!formatRules) {
return true;
return cardInfo.isLegalInFormat(format);
}
// Exceptions always win
@ -758,11 +759,7 @@ void DeckListModel::refreshCardFormatLegalities()
}
QString format = deckList->getGameFormat();
bool legal = exactCard.getInfo().isLegalInFormat(format);
if (legal) {
legal = isCardQuantityLegalForFormat(format, exactCard.getInfo(), currentCard->getNumber());
}
bool legal = isCardQuantityLegalForFormat(format, exactCard.getInfo(), currentCard->getNumber());
currentCard->setFormatLegality(legal);
}