diff --git a/src/gamestate.cpp b/src/gamestate.cpp index cfc51f6..a36c6b2 100644 --- a/src/gamestate.cpp +++ b/src/gamestate.cpp @@ -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";