bug: fix moveColumnCardToColumn for multi-card moves

This commit is contained in:
ItsDrike 2024-12-07 20:44:10 +01:00
parent 36167edc78
commit 985e99cf77
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -192,9 +192,18 @@ bool GameState::moveColumnCardToColumn(int fromColumnId, int toColumnId, int fro
return false; return false;
} }
// Success, move the card // Success, move the card, alongside all cards below it (if this is a multi-card move)
toColumnStack.append(col); for (int i = fromCardIndex; i < fromColumnStack.size(); ++i) {
fromColumnStack.removeLast(); ColumnSlot* curCol = fromColumnStack[i];
toColumnStack.append(curCol);
}
// Remove the moved cards
while (fromColumnStack.size() > fromCardIndex) {
ColumnSlot* curSlot = fromColumnStack.takeLast();
curSlot->deleteLater();
}
ensureColumnRevealed(fromColumnId); ensureColumnRevealed(fromColumnId);
qDebug() << "> Moving complete"; qDebug() << "> Moving complete";