From ef19ac8a6926bcb40c0320b995fd2da4a924d03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Mon, 7 Sep 2026 09:57:56 +0200 Subject: [PATCH] [Oracle] Prefer higher-priority maintype when merging split cards Adventure cards (e.g. Bonecrusher Giant, Virtue of Knowledge) are stored as split cards in MTGJSON, with a Creature/permanent face and an Instant/Sorcery adventure face. When the two faces are merged into a single card, the code previously discarded the second face's maintype entirely, keeping whichever face was processed first. If the Instant/Sorcery adventure face appeared first, the merged card got maintype 'Instant' with tableRow 3. At runtime this made double-clicking the card on the stack send it to the graveyard instead of the table (PlayerActions::playCard). Fix the merge to follow the same priority order used by getMainCardType() (Planeswalker > Creature > Land > Sorcery > Instant > Artifact > Enchantment), so the permanent Creature type wins for adventure cards regardless of face order, matching the physical card and the reported expectations. Closes #4394 --- oracle/src/oracleimporter.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/oracle/src/oracleimporter.cpp b/oracle/src/oracleimporter.cpp index d745b250c..4785ba066 100644 --- a/oracle/src/oracleimporter.cpp +++ b/oracle/src/oracleimporter.cpp @@ -460,8 +460,17 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QJson properties.insert(prop, thisCardPropertyValue); } else if (prop == "colors" || prop == "coloridentity") { // the card is both colors properties.insert(prop, originalPropertyValue + thisCardPropertyValue); - } else if (prop == "maintype") { // don't create maintypes with //es in them - continue; + } else if (prop == "maintype") { + // Use the same priority as getMainCardType() to pick the + // "best" type across faces — e.g. Creature over Instant + // for adventure cards. + static const QStringList typePriority = { + "Planeswalker", "Creature", "Land", "Sorcery", "Instant", "Artifact", "Enchantment"}; + int currentPriority = typePriority.indexOf(originalPropertyValue); + int newPriority = typePriority.indexOf(thisCardPropertyValue); + if (newPriority >= 0 && (currentPriority < 0 || newPriority < currentPriority)) { + properties.insert(prop, thisCardPropertyValue); + } } else { properties.insert(prop, originalPropertyValue + splitCardPropSeparator + thisCardPropertyValue);