Fix invalid index
This commit is contained in:
parent
80a5203c4b
commit
e9f4b367a6
@ -58,7 +58,7 @@ class Engine(private vararg val creatures : Pair<Creature, Int>) {
|
||||
private fun getTargetList(target : Target, selected : Int) : List<Int> {
|
||||
return when(target) {
|
||||
Target.Self -> listOf(currentCreature)
|
||||
Target.Selected -> listOf(selected)
|
||||
Target.Selected -> if (selected == -1) { listOf() } else { listOf(selected) }
|
||||
Target.Others -> creatures.indices.filter { it != currentCreature }
|
||||
Target.Opponents -> creatures.indices.filter { creatures[it].second != creatures[currentCreature].second }
|
||||
Target.All -> creatures.indices.toList()
|
||||
|
Loading…
Reference in New Issue
Block a user