Fix value bounds

This commit is contained in:
2023-01-31 22:32:32 +08:00
parent 44959fcf62
commit f631218c0c

View File

@ -28,7 +28,7 @@ object JDice : KotlinPlugin(
val count = if (c.isEmpty()) 1 else c.toInt()
val top = d.toInt()
if (count > 0 && top > 1) {
val value = random.nextInt(count, count * top) + 1
val value = random.nextInt(count, count * top + 1)
subject.sendMessage(message.quote() + value.toString())
}
}