Explorar o código

kernel: Use the current time as the default RNG seed

Use the current time, not zero, as the default RNG seed.
lat9nq %!s(int64=5) %!d(string=hai) anos
pai
achega
8bd246032a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/core/hle/kernel/process.cpp

+ 1 - 1
src/core/hle/kernel/process.cpp

@@ -123,7 +123,7 @@ std::shared_ptr<Process> Process::Create(Core::System& system, std::string name,
                                                               : kernel.CreateNewUserProcessID();
     process->capabilities.InitializeForMetadatalessProcess();
 
-    std::mt19937 rng(Settings::values.rng_seed.GetValue().value_or(0));
+    std::mt19937 rng(Settings::values.rng_seed.GetValue().value_or(std::time(nullptr)));
     std::uniform_int_distribution<u64> distribution;
     std::generate(process->random_entropy.begin(), process->random_entropy.end(),
                   [&] { return distribution(rng); });