Change the random method to Math.random to Random.nextInt()
This commit is contained in:
parent
aa82fc2347
commit
dc12434689
1 changed files with 1 additions and 1 deletions
|
|
@ -1128,7 +1128,7 @@ class DiceThrowUseCase @Inject constructor(
|
||||||
private fun random(faces: Int, fail: Boolean, critical: Boolean): Int = when {
|
private fun random(faces: Int, fail: Boolean, critical: Boolean): Int = when {
|
||||||
fail && !critical -> 1
|
fail && !critical -> 1
|
||||||
critical && !fail -> faces
|
critical && !fail -> faces
|
||||||
else -> (Math.random() * faces + 1).toInt()
|
else -> Random.nextInt(from = 1, until = faces + 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue