Remove unnecessary argument from CSimulation2::InitGame
Reviewed By: Itms Differential Revision: https://code.wildfiregames.com/D1289 This was SVN commit r21166.
This commit is contained in:
parent
29950c2d90
commit
262b27d770
@ -301,10 +301,7 @@ PSRETURN CGame::ReallyStartGame()
|
||||
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,
|
||||
|
@ -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 @@ void CSimulation2::PreInitGame()
|
||||
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)
|
||||
|
@ -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 @@ public:
|
||||
* (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<SimulationCommand>& commands);
|
||||
|
Loading…
Reference in New Issue
Block a user