Index: ps/trunk/source/ps/Game.cpp =================================================================== --- ps/trunk/source/ps/Game.cpp +++ ps/trunk/source/ps/Game.cpp @@ -301,10 +301,7 @@ if (!g_AtlasGameLoop->running) m_Simulation2->PreInitGame(); - JS::RootedValue settings(cx); - JS::RootedValue tmpInitAttributes(cx, m_Simulation2->GetInitAttributes()); - m_Simulation2->GetScriptInterface().GetProperty(tmpInitAttributes, "settings", &settings); - m_Simulation2->InitGame(settings); + m_Simulation2->InitGame(); } // We need to do an initial Interpolate call to set up all the models etc, Index: ps/trunk/source/simulation2/Simulation2.h =================================================================== --- ps/trunk/source/simulation2/Simulation2.h +++ ps/trunk/source/simulation2/Simulation2.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 Wildfire Games. +/* Copyright (C) 2018 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -166,7 +166,7 @@ * (This mustn't be used when e.g. loading saved games, only when starting new ones.) * This calls the InitGame function defined in helpers/InitGame.js. */ - void InitGame(JS::HandleValue data); + void InitGame(); void Update(int turnLength); void Update(int turnLength, const std::vector& commands); Index: ps/trunk/source/simulation2/Simulation2.cpp =================================================================== --- ps/trunk/source/simulation2/Simulation2.cpp +++ ps/trunk/source/simulation2/Simulation2.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2018 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -737,12 +737,17 @@ GetScriptInterface().CallFunctionVoid(global, "PreInitGame"); } -void CSimulation2::InitGame(JS::HandleValue data) +void CSimulation2::InitGame() { JSContext* cx = GetScriptInterface().GetContext(); JSAutoRequest rq(cx); JS::RootedValue global(cx, GetScriptInterface().GetGlobalObject()); - GetScriptInterface().CallFunctionVoid(global, "InitGame", data); + + JS::RootedValue settings(cx); + JS::RootedValue tmpInitAttributes(cx, GetInitAttributes()); + GetScriptInterface().GetProperty(tmpInitAttributes, "settings", &settings); + + GetScriptInterface().CallFunctionVoid(global, "InitGame", settings); } void CSimulation2::Update(int turnLength)