diff options
author | George Marques <george@gmarqu.es> | 2021-05-03 11:06:46 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2021-05-03 11:08:39 -0300 |
commit | 7610fc02a0ad0e6106a61da2f97b1ad85bca7ea8 (patch) | |
tree | fcf2a09ccdffcf987961dc6dc1477ab3a36a3f43 /core/math | |
parent | 883296382d2d03de6add0868b09577c21a344306 (diff) |
Cast Unix time to uint in the randomize function
This returns a double while the other values are all uint64_t. The
clang compiler gives a warning since converting the constant to double
loses precision.
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/random_pcg.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/random_pcg.cpp b/core/math/random_pcg.cpp index 1152c4e834..681c2a9717 100644 --- a/core/math/random_pcg.cpp +++ b/core/math/random_pcg.cpp @@ -39,7 +39,7 @@ RandomPCG::RandomPCG(uint64_t p_seed, uint64_t p_inc) : } void RandomPCG::randomize() { - seed((OS::get_singleton()->get_unix_time() + OS::get_singleton()->get_ticks_usec()) * pcg.state + PCG_DEFAULT_INC_64); + seed(((uint64_t)OS::get_singleton()->get_unix_time() + OS::get_singleton()->get_ticks_usec()) * pcg.state + PCG_DEFAULT_INC_64); } double RandomPCG::random(double p_from, double p_to) { |