Skip to content

Commit ba660a8

Browse files
committed
fix(plugin24/GameState): limit movement to 6
1 parent 8f842a5 commit ba660a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/src/main/kotlin/sc/plugin2024/GameState.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,11 @@ data class GameState @JvmOverloads constructor(
261261
* Does not honor special conditions of the starting tile.
262262
* @return how far movement is possible, how many movement points it costs and why not further
263263
* */
264-
fun checkAdvanceLimit(start: CubeCoordinates, direction: CubeDirection, maxMovement: Int): AdvanceInfo {
264+
fun checkAdvanceLimit(start: CubeCoordinates, direction: CubeDirection, maxMovementPoints: Int): AdvanceInfo {
265265
var currentPosition = start
266266
var totalCost = 0
267267
var hasCurrent = false
268+
val maxMovement = maxMovementPoints.coerceAtMost(6)
268269
val result = ArrayList<Int>(maxMovement)
269270

270271
fun result(condition: AdvanceProblem) =

0 commit comments

Comments
 (0)