diff --git a/src/gamestate.cpp b/src/gamestate.cpp index 878b993..c2e3081 100644 --- a/src/gamestate.cpp +++ b/src/gamestate.cpp @@ -451,7 +451,6 @@ void GameState::cleanupBoard(bool emitChanges) { QString GameState::generateStateHash() const { QString stateHash; - // The repetition here is annoying, I know for (const auto& column : m_columns) { for (const ColumnSlot* slot : column) { stateHash += QString::number(slot->card()->value()) + "." + QString::number(slot->card()->suit()); @@ -592,10 +591,8 @@ bool GameState::isColumnMoveValid(const PlayingCard& cardToMove, int columnId) c const PlayingCard& columnCard = *columnStack.last()->card(); // The card's value must be one less than the card in the column - if (cardToMove.value() != columnCard.value() - 1) { - qDebug() << "* Move attempt failed (wrong value)"; + if (cardToMove.value() != static_cast(static_cast(columnCard.value() - 1))) return false; - } // The card must be of opposite color return PlayingCard::areOppositeColors(cardToMove, columnCard);