Removed unnecessary check to prevent cards from moving to the same position

This commit is contained in:
DawnFire42 2026-08-10 12:07:42 -04:00
parent f28ceca1de
commit b688405af3
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
2 changed files with 0 additions and 14 deletions

View file

@ -105,15 +105,8 @@ void CommandZone::handleDropEvent(const QList<CardDragItem *> &dragItems,
return;
}
const auto &cards = getLogic()->getCards();
int index = calcDropIndexFromY(dropPoint.y(), MIN_CARD_VISIBLE);
// Same-zone no-op: don't move a card onto itself (index may equal size for append)
if (startZone == getLogic() && !cards.isEmpty() &&
cards.at(qMin(index, static_cast<int>(cards.size()) - 1))->getId() == dragItems.at(0)->getId()) {
return;
}
Command_MoveCard cmd;
cmd.set_start_player_id(startZone->getPlayer()->getPlayerInfo()->getId());
cmd.set_start_zone(startZone->getName().toStdString());

View file

@ -47,15 +47,8 @@ void StackZone::handleDropEvent(const QList<CardDragItem *> &dragItems,
return;
}
const auto &cards = getLogic()->getCards();
int index = calcDropIndexFromY(dropPoint.y(), MIN_CARD_VISIBLE);
// Same-zone no-op: don't move a card onto itself (index may equal size for append)
if (startZone == getLogic() && !cards.isEmpty() &&
cards.at(qMin(index, static_cast<int>(cards.size()) - 1))->getId() == dragItems.at(0)->getId()) {
return;
}
Command_MoveCard cmd;
cmd.set_start_player_id(startZone->getPlayer()->getPlayerInfo()->getId());
cmd.set_start_zone(startZone->getName().toStdString());