Skip to content

Commit 6347b65

Browse files
committed
Only consider distinct actions as matching
1 parent 7e36555 commit 6347b65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

games-core/src/main/kotlin/net/zomis/games/dsl/impl/ActionsImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ActionTypeImplEntry<T : Any, P : Any>(private val model: T,
5454
val expectedSingleAction = availableActions(actionOptionsContext.playerIndex).filter { action2 ->
5555
actionType.serialize(action2.parameter) == serialized
5656
}
57-
expectedSingleAction.singleOrNull() ?: throw IllegalArgumentException("Unable to deserialize $serialized, matching deserialized actions is $expectedSingleAction")
57+
expectedSingleAction.distinct().singleOrNull() ?: throw IllegalArgumentException("Unable to deserialize $serialized, matching deserialized actions is $expectedSingleAction")
5858
} else {
5959
createAction(actionOptionsContext.playerIndex, parameter)
6060
}

0 commit comments

Comments
 (0)