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;
|
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";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue