diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp index e400246a..4c21bcde 100644 --- a/cockatrice/src/player.cpp +++ b/cockatrice/src/player.cpp @@ -2855,8 +2855,14 @@ void Player::actCardCounterTrigger() case 11: { // set counter with dialog bool ok; dialogSemaphore = true; - int number = - QInputDialog::getInt(nullptr, tr("Set counters"), tr("Number:"), 0, 0, MAX_COUNTERS_ON_CARD, 1, &ok); + + int oldValue = 0; + if (scene()->selectedItems().size() == 1) { + auto *card = static_cast(scene()->selectedItems().first()); + oldValue = card->getCounters().value(counterId, 0); + } + int number = QInputDialog::getInt(nullptr, tr("Set counters"), tr("Number:"), oldValue, 0, + MAX_COUNTERS_ON_CARD, 1, &ok); dialogSemaphore = false; if (clearCardsToDelete() || !ok) { return;