We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56093f5 commit c14e823Copy full SHA for c14e823
src/main/java/io/github/techstreet/dfscript/script/action/ScriptActionType.java
@@ -1614,10 +1614,10 @@ public enum ScriptActionType {
1614
.arg("Min", ScriptActionArgumentType.NUMBER)
1615
.arg("Max", ScriptActionArgumentType.NUMBER)
1616
.action(ctx -> {
1617
- int min = ctx.value("Min").asNumber();
1618
- int max = ctx.value("Max").asNumber();
+ int min = (int) ctx.value("Min").asNumber();
+ int max = (int) ctx.value("Max").asNumber();
1619
Random random = new Random();
1620
- int result = random.nextInt((int) max + 1 - (int) min) + (int) min;
+ int result = random.nextInt(max + 1 - min) + min;
1621
ctx.context().setVariable(
1622
ctx.variable("Result").name(),
1623
new ScriptNumberValue(result)
0 commit comments