Skip to content

Commit

Permalink
Merge pull request #48098 from KoBeWi/you_never_know
Browse files Browse the repository at this point in the history
Make randomize() use unix time instead of ticks
  • Loading branch information
akien-mga committed Apr 23, 2021
2 parents 492b8aa + 22efa85 commit c04681b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/math/random_pcg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c04681b

Please sign in to comment.