Skip to content

Commit 6f4575e

Browse files
committed
Revert to default behaviour
1 parent fd66446 commit 6f4575e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/org/skriptlang/skript/common/elements/functions/MathFunctions.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private static String str(double n) {
226226
.build(args -> {
227227
Number[] ns = args.get("ns");
228228
if (ns.length == 0)
229-
return 0;
229+
return null;
230230

231231
double sum = ns[0].doubleValue();
232232
for (int i = 1; i < ns.length; i++)
@@ -242,7 +242,7 @@ private static String str(double n) {
242242
.build(args -> {
243243
Number[] ns = args.get("ns");
244244
if (ns.length == 0)
245-
return 0;
245+
return null;
246246

247247
double product = ns[0].doubleValue();
248248
for (int i = 1; i < ns.length; i++)
@@ -258,7 +258,7 @@ private static String str(double n) {
258258
.build(args -> {
259259
Number[] ns = args.get("ns");
260260
if (ns.length == 0)
261-
return 0;
261+
return null;
262262

263263
double max = ns[0].doubleValue();
264264
for (int i = 1; i < ns.length; i++) {
@@ -277,7 +277,7 @@ private static String str(double n) {
277277
.build(args -> {
278278
Number[] ns = args.get("ns");
279279
if (ns.length == 0)
280-
return 0;
280+
return null;
281281

282282
double min = ns[0].doubleValue();
283283
for (int i = 1; i < ns.length; i++) {
@@ -325,7 +325,7 @@ public Class<?> getReturnType(Expression<?>... arguments) {
325325
if (!Double.isNaN(value) && !Double.isNaN(trueMin) && !Double.isNaN(trueMax)) {
326326
clampedValues[i] = Math.clamp(value, trueMin, trueMax);
327327
} else {
328-
clampedValues[i] = 0d;
328+
clampedValues[i] = Double.NaN;
329329
}
330330
}
331331
return clampedValues;

0 commit comments

Comments
 (0)