From 94a4d5b13a7457b83654177de5ab28a663cc6b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Tue, 9 Jun 2026 08:04:24 +0200 Subject: [PATCH] Capture cards before semaphore. Took 1 minute --- cockatrice/src/game/player/player_dialogs.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/game/player/player_dialogs.cpp b/cockatrice/src/game/player/player_dialogs.cpp index 416c551b3..3c26ae1fe 100644 --- a/cockatrice/src/game/player/player_dialogs.cpp +++ b/cockatrice/src/game/player/player_dialogs.cpp @@ -248,6 +248,7 @@ void PlayerDialogs::onMoveCardXCardsFromTopDialogRequested(int defaultNumberTopC void PlayerDialogs::onSetPTDialogRequested(const QString &oldPT) { bool ok; + auto cards = player->getGameScene()->selectedCards(); emit requestDialogSemaphore(true); QString pt = getTextWithMax(dialogParent(), tr("Change power/toughness"), tr("Change stats to:"), QLineEdit::Normal, oldPT, &ok); @@ -257,11 +258,12 @@ void PlayerDialogs::onSetPTDialogRequested(const QString &oldPT) return; } - playerActions->actSetPT(player->getGameScene()->selectedCards(), pt); + playerActions->actSetPT(cards, pt); } void PlayerDialogs::onSetAnnotationDialogRequested(const QString &oldAnnotation) { + auto cards = player->getGameScene()->selectedCards(); emit requestDialogSemaphore(true); AnnotationDialog *dialog = new AnnotationDialog(dialogParent()); dialog->setOptions(QInputDialog::UsePlainTextEditForTextInput); @@ -274,11 +276,12 @@ void PlayerDialogs::onSetAnnotationDialogRequested(const QString &oldAnnotation) return; } QString annotation = dialog->textValue().left(MAX_NAME_LENGTH); - playerActions->actSetAnnotation(player->getGameScene()->selectedCards(), annotation); + playerActions->actSetAnnotation(cards, annotation); } void PlayerDialogs::onSetCardCounterDialogRequested(int counterId, const QString &oldValueForDlg) { + auto cards = player->getGameScene()->selectedCards(); emit requestDialogSemaphore(true); auto &cardCounterSettings = SettingsCache::instance().cardCounters(); @@ -291,5 +294,5 @@ void PlayerDialogs::onSetCardCounterDialogRequested(int counterId, const QString if (!ok || player->getLogic()->clearCardsToDelete()) { return; } - playerActions->actSetCardCounter(player->getGameScene()->selectedCards(), counterId, dialog.textValue()); + playerActions->actSetCardCounter(cards, counterId, dialog.textValue()); } \ No newline at end of file