浏览代码

Merge pull request #48407 from vnen/randomize-use-same-type

Cast Unix time to uint in the randomize function
Rémi Verschelde 4 年之前
父节点
当前提交
bd215f0195
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/math/random_pcg.cpp

+ 1 - 1
core/math/random_pcg.cpp

@@ -39,7 +39,7 @@ RandomPCG::RandomPCG(uint64_t p_seed, uint64_t p_inc) :
 }
 }
 
 
 void RandomPCG::randomize() {
 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) {
 double RandomPCG::random(double p_from, double p_to) {