diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/GameController.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/GameController.kt index b4ade5cc..b9d3a854 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/common/level/GameController.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/GameController.kt @@ -111,7 +111,7 @@ class GameController { } } ActionResponse.OpenNeighbors -> { - minefieldHandler.openNeighborsOf(target.id) + minefieldHandler.openOrFlagNeighborsOf(target.id) } } diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/MinefieldHandler.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/MinefieldHandler.kt index bca47866..ac92d28e 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/MinefieldHandler.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/MinefieldHandler.kt @@ -76,7 +76,7 @@ class MinefieldHandler( } } - fun openNeighborsOf(index: Int) { + fun openOrFlagNeighborsOf(index: Int) { field.getOrNull(index)?.run { val neighbors = field.filterNeighborsOf(this) val flaggedCount = neighbors.count { it.mark.isFlag() }