Skip to content

Commit 09802ec

Browse files
author
Erik
authored
fix(plugin/GameState): correctly clone fishes array (#415)
Closes #414
1 parent de424a8 commit 09802ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ data class GameState @JvmOverloads constructor(
2525
override var lastMove: Move? = null,
2626
val fishes: IntArray = IntArray(Team.values().size),
2727
): TwoPlayerGameState<Move>(Team.ONE) {
28-
29-
constructor(other: GameState): this(other.board.clone(), other.turn, other.lastMove, other.fishes)
28+
29+
constructor(other: GameState): this(other.board.clone(), other.turn, other.lastMove, other.fishes.clone())
3030

3131
override val currentTeam: Team
3232
get() = currentTeamFromTurn().run { takeIf { !immovable(it) } ?: opponent() }

0 commit comments

Comments
 (0)