bug: fix manual cross-column movement logic
The original implementation didn't use references for the QList instances, which meant they were getting copied, so the changes made didn't mutate the actual values held by the class.
This commit is contained in:
parent
5240949353
commit
18891308bc
|
@ -184,8 +184,8 @@ bool GameState::moveThrownCardToFoundation(int foundationId) {
|
||||||
bool GameState::moveColumnCardToColumn(int fromColumnId, int toColumnId, int fromCardIndex) {
|
bool GameState::moveColumnCardToColumn(int fromColumnId, int toColumnId, int fromCardIndex) {
|
||||||
assert(fromColumnId >= 0 && fromColumnId < 7);
|
assert(fromColumnId >= 0 && fromColumnId < 7);
|
||||||
assert(toColumnId >= 0 && toColumnId < 7);
|
assert(toColumnId >= 0 && toColumnId < 7);
|
||||||
auto fromColumnStack = m_columns[fromColumnId];
|
auto& fromColumnStack = m_columns[fromColumnId];
|
||||||
auto toColumnStack = m_columns[toColumnId];
|
auto& toColumnStack = m_columns[toColumnId];
|
||||||
|
|
||||||
if (fromColumnStack.isEmpty()) {
|
if (fromColumnStack.isEmpty()) {
|
||||||
qWarning() << "Attempted to move card(s) to column from an empty column";
|
qWarning() << "Attempted to move card(s) to column from an empty column";
|
||||||
|
|
Loading…
Reference in a new issue