mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 08:52:19 -07:00
[Game] Fix dragged card always placed on bottom of stack
This commit is contained in:
parent
68e4fa054d
commit
f0250c772a
1 changed files with 1 additions and 6 deletions
|
|
@ -58,17 +58,12 @@ void StackZone::handleDropEvent(const QList<CardDragItem *> &dragItems,
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto &cards = getLogic()->getCards();
|
const auto &cards = getLogic()->getCards();
|
||||||
int index;
|
int index = calcDropIndexFromY(dropPoint.y(), MIN_CARD_VISIBLE);
|
||||||
if (startZone == getLogic()) {
|
if (startZone == getLogic()) {
|
||||||
// Reordering within the zone: use drop position
|
|
||||||
index = calcDropIndexFromY(dropPoint.y(), MIN_CARD_VISIBLE);
|
|
||||||
// Same-zone no-op: don't move a card onto itself
|
// Same-zone no-op: don't move a card onto itself
|
||||||
if (!cards.isEmpty() && cards.at(index)->getId() == dragItems.at(0)->getId()) {
|
if (!cards.isEmpty() && cards.at(index)->getId() == dragItems.at(0)->getId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Coming from another zone: append at end (top of stack, rendered on top)
|
|
||||||
index = static_cast<int>(cards.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Command_MoveCard cmd;
|
Command_MoveCard cmd;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue