mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 03:28:49 -07:00
[DeckListModel] Fix exception precedence in legality check (#6535)
This commit is contained in:
parent
f7e71a0868
commit
485d5a8b48
1 changed files with 3 additions and 6 deletions
|
|
@ -709,8 +709,9 @@ static bool isCardQuantityLegalForFormat(const QString &format, const CardInfo &
|
||||||
|
|
||||||
auto formatRules = CardDatabaseManager::query()->getFormat(format);
|
auto formatRules = CardDatabaseManager::query()->getFormat(format);
|
||||||
|
|
||||||
|
// if format has no custom rules, then just do the default check
|
||||||
if (!formatRules) {
|
if (!formatRules) {
|
||||||
return true;
|
return cardInfo.isLegalInFormat(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exceptions always win
|
// Exceptions always win
|
||||||
|
|
@ -758,11 +759,7 @@ void DeckListModel::refreshCardFormatLegalities()
|
||||||
}
|
}
|
||||||
|
|
||||||
QString format = deckList->getGameFormat();
|
QString format = deckList->getGameFormat();
|
||||||
bool legal = exactCard.getInfo().isLegalInFormat(format);
|
bool legal = isCardQuantityLegalForFormat(format, exactCard.getInfo(), currentCard->getNumber());
|
||||||
|
|
||||||
if (legal) {
|
|
||||||
legal = isCardQuantityLegalForFormat(format, exactCard.getInfo(), currentCard->getNumber());
|
|
||||||
}
|
|
||||||
|
|
||||||
currentCard->setFormatLegality(legal);
|
currentCard->setFormatLegality(legal);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue