mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user