summaryrefslogtreecommitdiffstats
path: root/core/math/random_number_generator.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/random_number_generator.h')
-rw-r--r--core/math/random_number_generator.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/math/random_number_generator.h b/core/math/random_number_generator.h
index 2b125433b3..920308e597 100644
--- a/core/math/random_number_generator.h
+++ b/core/math/random_number_generator.h
@@ -59,10 +59,11 @@ public:
_FORCE_INLINE_ int randi_range(int from, int to) {
unsigned int ret = randbase.rand();
- if (to < from)
+ if (to < from) {
return ret % (from - to + 1) + to;
- else
+ } else {
return ret % (to - from + 1) + from;
+ }
}
RandomNumberGenerator() {}