mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-21 09:52:16 -07:00
Only overwrite card in deck if UUID _and_ Number missing
This commit is contained in:
parent
050c86cee6
commit
7d42a43c87
4 changed files with 39 additions and 19 deletions
|
|
@ -156,12 +156,17 @@ AbstractDecklistNode *InnerDecklistNode::findChild(const QString &_name)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
AbstractDecklistNode *InnerDecklistNode::findCardChildByNameAndProviderId(const QString &_name,
|
||||
const QString &_providerId)
|
||||
AbstractDecklistNode *InnerDecklistNode::findCardChildByNameProviderIdAndNumber(const QString &_name,
|
||||
const QString &_providerId,
|
||||
const QString &_cardNumber)
|
||||
{
|
||||
for (int i = 0; i < size(); i++) {
|
||||
if (at(i) != nullptr && at(i)->getName() == _name && at(i)->getCardProviderId() == _providerId) {
|
||||
return at(i);
|
||||
for (const auto &i : *this) {
|
||||
if (i != nullptr && i->getName() == _name) {
|
||||
if (i->getCardCollectorNumber() == _cardNumber) {
|
||||
if (i->getCardProviderId() == _providerId) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue