mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
Fixed decrementCard for tokens not using the token zone
This commit is contained in:
parent
ea6af0048c
commit
76cfe067b9
1 changed files with 4 additions and 2 deletions
|
|
@ -234,10 +234,12 @@ QModelIndex DeckStateManager::decrementCard(const ExactCard &card, const QString
|
|||
return {};
|
||||
}
|
||||
|
||||
QString zone = card.getInfo().getIsToken() ? DECK_ZONE_TOKENS : zoneName;
|
||||
|
||||
QString providerId = card.getPrinting().getUuid();
|
||||
QString collectorNumber = card.getPrinting().getProperty("num");
|
||||
|
||||
QModelIndex idx = deckListModel->findCard(card.getName(), zoneName, providerId, collectorNumber);
|
||||
QModelIndex idx = deckListModel->findCard(card.getName(), zone, providerId, collectorNumber);
|
||||
if (!idx.isValid()) {
|
||||
return {};
|
||||
}
|
||||
|
|
@ -249,7 +251,7 @@ QModelIndex DeckStateManager::decrementCard(const ExactCard &card, const QString
|
|||
}
|
||||
|
||||
// old index is no longer safe since rows could have been removed
|
||||
QModelIndex newIdx = deckListModel->findCard(card.getName(), zoneName, providerId, collectorNumber);
|
||||
QModelIndex newIdx = deckListModel->findCard(card.getName(), zone, providerId, collectorNumber);
|
||||
if (newIdx.isValid()) {
|
||||
emit focusIndexChanged(newIdx, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue