bug: fix moveColumnCardToColumn for multi-card moves
This commit is contained in:
parent
36167edc78
commit
985e99cf77
|
@ -192,9 +192,18 @@ bool GameState::moveColumnCardToColumn(int fromColumnId, int toColumnId, int fro
|
|||
return false;
|
||||
}
|
||||
|
||||
// Success, move the card
|
||||
toColumnStack.append(col);
|
||||
fromColumnStack.removeLast();
|
||||
// Success, move the card, alongside all cards below it (if this is a multi-card move)
|
||||
for (int i = fromCardIndex; i < fromColumnStack.size(); ++i) {
|
||||
ColumnSlot* curCol = fromColumnStack[i];
|
||||
toColumnStack.append(curCol);
|
||||
}
|
||||
|
||||
// Remove the moved cards
|
||||
while (fromColumnStack.size() > fromCardIndex) {
|
||||
ColumnSlot* curSlot = fromColumnStack.takeLast();
|
||||
curSlot->deleteLater();
|
||||
}
|
||||
|
||||
ensureColumnRevealed(fromColumnId);
|
||||
qDebug() << "> Moving complete";
|
||||
|
||||
|
|
Loading…
Reference in a new issue