From 485d5a8b4850cd89648c279ef516f3eda34beee2 Mon Sep 17 00:00:00 2001 From: RickyRister <42636155+RickyRister@users.noreply.github.com> Date: Mon, 19 Jan 2026 00:28:13 -0800 Subject: [PATCH] [DeckListModel] Fix exception precedence in legality check (#6535) --- .../libcockatrice/models/deck_list/deck_list_model.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libcockatrice_models/libcockatrice/models/deck_list/deck_list_model.cpp b/libcockatrice_models/libcockatrice/models/deck_list/deck_list_model.cpp index 447d868a8..aa95b444e 100644 --- a/libcockatrice_models/libcockatrice/models/deck_list/deck_list_model.cpp +++ b/libcockatrice_models/libcockatrice/models/deck_list/deck_list_model.cpp @@ -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); }