mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
parent
933f3e1392
commit
bcf505c98b
1 changed files with 8 additions and 1 deletions
|
|
@ -82,11 +82,16 @@ bool OracleImporter::readSetsFromByteArray(const QByteArray &data)
|
|||
|
||||
QString OracleImporter::getMainCardType(const QStringList &typeList)
|
||||
{
|
||||
if (typeList.isEmpty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
for (const auto &type : mainCardTypes) {
|
||||
if (typeList.contains(type)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
return typeList.first();
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +296,9 @@ int OracleImporter::importCardsFromSet(CardSetPtr currentSet, const QList<QVaria
|
|||
}
|
||||
|
||||
const auto &mainCardType = getMainCardType(card.value("types").toStringList());
|
||||
if (!mainCardType.isEmpty()) {
|
||||
if (mainCardType.isEmpty()) {
|
||||
qDebug() << "warning: no mainCardType for card:" << name;
|
||||
} else {
|
||||
properties.insert("maintype", mainCardType);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue