Actually seed the random number generator used in the simulation. Reviewed by sanderd17, fixes #4127.

This was SVN commit r18604.
This commit is contained in:
elexis
2016-08-14 16:28:54 +00:00
parent 00a469be1b
commit 6eaf76d653
6 changed files with 49 additions and 9 deletions
+6
View File
@@ -752,6 +752,12 @@ void CSimulation2::SetMapSettings(const std::string& settings)
void CSimulation2::SetMapSettings(JS::HandleValue settings)
{
m->m_MapSettings = settings;
u32 seed = 0;
if (!m->m_ComponentManager.GetScriptInterface().GetProperty(m->m_MapSettings, "Seed", seed))
LOGWARNING("CSimulation2::SetInitAttributes: No seed value specified - using %d", seed);
m->m_ComponentManager.SetRNGSeed(seed);
}
std::string CSimulation2::GetMapSettingsString()