Cockatrice/oracle/src
BruebachL 69e8f80fa1
Some checks failed
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Build Desktop / Configure (push) Has been cancelled
Build Docker / Servatrice (arm) (push) Has been cancelled
Build Docker / Servatrice (x86) (push) Has been cancelled
Build Desktop / Debian 13 (push) Has been cancelled
Build Desktop / Debian 12 (push) Has been cancelled
Build Desktop / Fedora 44 (push) Has been cancelled
Build Desktop / Fedora 43 (push) Has been cancelled
Build Desktop / Servatrice_Debian 12 (push) Has been cancelled
Build Desktop / Ubuntu 26.04 (push) Has been cancelled
Build Desktop / Ubuntu 24.04 (push) Has been cancelled
Build Desktop / Arch (push) Has been cancelled
Build Desktop / macOS 13 Intel (push) Has been cancelled
Build Desktop / macOS 14 (push) Has been cancelled
Build Desktop / macOS 15 (push) Has been cancelled
Build Desktop / macOS 26 Debug (push) Has been cancelled
Build Desktop / Windows 10 (push) Has been cancelled
Build Docker / Publish multi-platform Servatrice image (push) Has been cancelled
[Oracle] Prefer higher-priority maintype when merging split cards (#7272)
* [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

* Extract helper.

* Simplify const

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-09-07 21:22:53 +02:00
..
lzma [WIP] Basic mtgjsonv4 support (#3458) 2018-12-20 18:05:03 -05:00
zip Docs: Use Doxygen \todo comments (#6421) 2025-12-15 00:13:16 +01:00
main.cpp [CI] Remove Qt5 (#7071) 2026-08-08 22:04:50 +02:00
main.h workaround for foreign card arts getting priority by default (#3652) 2019-03-12 10:12:31 +01:00
oracleimporter.cpp [Oracle] Prefer higher-priority maintype when merging split cards (#7272) 2026-09-07 21:22:53 +02:00
oracleimporter.h [Oracle] Parse sets lazily to slash importer peak memory (#7217) 2026-09-05 20:35:28 +02:00
oraclewizard.cpp [Settings] Split cache_settings monolith into multiple SettingsManager sub-classes (#7050) 2026-07-27 11:25:39 +02:00
oraclewizard.h [Oracle] Move oracle settings to separate file (#6588) 2026-02-07 21:44:49 -05:00
pages.cpp [Oracle] Have space between size value and unit (#7254) 2026-09-06 22:19:13 +02:00
pages.h [Oracle] Support importing tokens and spoilers from local file (#6387) 2025-12-03 00:19:56 -05:00
pagetemplates.cpp [Oracle] Support importing tokens and spoilers from local file (#6387) 2025-12-03 00:19:56 -05:00
pagetemplates.h Run formatter on all our files (#6942) 2026-05-26 15:11:38 -07:00
parsehelpers.cpp Optimize cipt parsing by early returning (#5727) 2025-03-15 21:23:41 +00:00
parsehelpers.h Update cipt parsing (#5712) 2025-03-14 21:44:13 -04:00
raw_json_scanner.cpp [Oracle] Parse sets lazily to slash importer peak memory (#7217) 2026-09-05 20:35:28 +02:00
raw_json_scanner.h [Oracle] Parse sets lazily to slash importer peak memory (#7217) 2026-09-05 20:35:28 +02:00