summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-23 11:45:58 +0200
committerGitHub <noreply@github.com>2021-04-23 11:45:58 +0200
commitc04681b969f3e280b1a110658a69a3fdcd663421 (patch)
tree627ccc7ea38208d45a387c36449efc177eaca738
parent492b8aa9a5c440ec1fc64667915038f64c828f8a (diff)
parent22efa850bd8c10c6f8cc0f99664f660b14c92ffc (diff)
Merge pull request #48098 from KoBeWi/you_never_know
Make randomize() use unix time instead of ticks
-rw-r--r--core/math/random_pcg.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/random_pcg.cpp b/core/math/random_pcg.cpp
index 9609620469..1152c4e834 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_ticks_usec() * pcg.state + PCG_DEFAULT_INC_64);
+ seed((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) {