From f7fa8521b7f60d7479aca1030e647b3c7fe6903c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Wed, 13 Nov 2024 14:33:38 +0100 Subject: [PATCH] Mainboard/Sideboard swaps should respect the UUID from the old zone instead of just blindly adding preferredPrinting. --- cockatrice/src/client/tabs/tab_deck_editor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/client/tabs/tab_deck_editor.cpp b/cockatrice/src/client/tabs/tab_deck_editor.cpp index e5a27324f..fa69ef5ab 100644 --- a/cockatrice/src/client/tabs/tab_deck_editor.cpp +++ b/cockatrice/src/client/tabs/tab_deck_editor.cpp @@ -1029,6 +1029,7 @@ void TabDeckEditor::actSwapCard() if (!currentIndex.isValid()) return; const QString cardName = currentIndex.sibling(currentIndex.row(), 1).data().toString(); + const QString cardUUID = currentIndex.sibling(currentIndex.row(), 2).data().toString(); const QModelIndex gparent = currentIndex.parent().parent(); if (!gparent.isValid()) @@ -1038,8 +1039,9 @@ void TabDeckEditor::actSwapCard() actDecrement(); const QString otherZoneName = zoneName == DECK_ZONE_MAIN ? DECK_ZONE_SIDE : DECK_ZONE_MAIN; - // Third argument (true) says create the card no mater what, even if not in DB - QModelIndex newCardIndex = deckModel->addPreferredPrintingCard(cardName, otherZoneName, true); + // Third argument (true) says create the card no matter what, even if not in DB + QModelIndex newCardIndex = deckModel->addCard( + cardName, CardDatabaseManager::getInstance()->getSpecificSetForCard(cardName, cardUUID), otherZoneName, true); recursiveExpand(newCardIndex); setModified(true);