Merge pull request #1190 from ctrlaltca/fix_1188
oracle: fix broken import of sets; fix #1188
This commit is contained in:
commit
14e8fcdd44
1 changed files with 30 additions and 25 deletions
|
@ -76,6 +76,10 @@ CardInfo *OracleImporter::addCard(const QString &setName,
|
||||||
cardName = cardName.replace("Æ", "AE");
|
cardName = cardName.replace("Æ", "AE");
|
||||||
cardName = cardName.replace("’", "'");
|
cardName = cardName.replace("’", "'");
|
||||||
|
|
||||||
|
CardInfo * card;
|
||||||
|
if (cards.contains(cardName)) {
|
||||||
|
card = cards.value(cardName);
|
||||||
|
} else {
|
||||||
// Remove {} around mana costs
|
// Remove {} around mana costs
|
||||||
cardCost.remove(QChar('{'));
|
cardCost.remove(QChar('{'));
|
||||||
cardCost.remove(QChar('}'));
|
cardCost.remove(QChar('}'));
|
||||||
|
@ -91,7 +95,7 @@ CardInfo *OracleImporter::addCard(const QString &setName,
|
||||||
bool cipt = cardText.contains("Hideaway") || (cardText.contains(cardName + " enters the battlefield tapped") && !cardText.contains(cardName + " enters the battlefield tapped unless"));
|
bool cipt = cardText.contains("Hideaway") || (cardText.contains(cardName + " enters the battlefield tapped") && !cardText.contains(cardName + " enters the battlefield tapped unless"));
|
||||||
|
|
||||||
// insert the card and its properties
|
// insert the card and its properties
|
||||||
CardInfo *card = new CardInfo(this, cardName, isToken, cardCost, cmc, cardType, cardPT, cardText, colors, relatedCards, upsideDown, cardLoyalty, cipt);
|
card = new CardInfo(this, cardName, isToken, cardCost, cmc, cardType, cardPT, cardText, colors, relatedCards, upsideDown, cardLoyalty, cipt);
|
||||||
int tableRow = 1;
|
int tableRow = 1;
|
||||||
QString mainCardType = card->getMainCardType();
|
QString mainCardType = card->getMainCardType();
|
||||||
if ((mainCardType == "Land") || mArtifact)
|
if ((mainCardType == "Land") || mArtifact)
|
||||||
|
@ -103,6 +107,7 @@ CardInfo *OracleImporter::addCard(const QString &setName,
|
||||||
card->setTableRow(tableRow);
|
card->setTableRow(tableRow);
|
||||||
|
|
||||||
cards.insert(cardName, card);
|
cards.insert(cardName, card);
|
||||||
|
}
|
||||||
card->setMuId(setName, cardId);
|
card->setMuId(setName, cardId);
|
||||||
|
|
||||||
return card;
|
return card;
|
||||||
|
|
Loading…
Reference in a new issue