Skip to content

Commit

Permalink
Add check for locked cell in processInput
Browse files Browse the repository at this point in the history
Closes #33
  • Loading branch information
kaajjo committed Feb 28, 2023
1 parent d7e5112 commit 1f24497
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,13 @@ class GameViewModel @Inject constructor(
fun processInput(cell: Cell, remainingUse: Boolean, longTap: Boolean = false): Boolean {
if (gamePlaying) {
currCell =
if (currCell.row == cell.row && currCell.col == cell.col && digitFirstNumber == 0) Cell(
-1,
-1
) else cell
if (currCell.row == cell.row && currCell.col == cell.col && digitFirstNumber == 0) {
Cell(-1, -1)
} else {
cell
}

if (currCell.row >= 0 && currCell.col >= 0) {
if (currCell.row >= 0 && currCell.col >= 0 && !gameBoard[currCell.row][currCell.col].locked) {
if ((inputMethod.value == 1 || overrideInputMethodDF) && digitFirstNumber > 0) {
if (!longTap) {
if ((remainingUsesList.size >= digitFirstNumber && remainingUsesList[digitFirstNumber - 1] > 0) || !remainingUse) {
Expand Down

0 comments on commit 1f24497

Please sign in to comment.