forked from mirrors/0ad
Pass ooslog-activate flag on construction
This deduplicates the activation logic and removes the only `m_EnableOOSLog` mutation.
This commit is contained in:
+3
-2
@@ -77,9 +77,10 @@ const CStr CGame::EventNameSimulationUpdate = "SimulationUpdate";
|
||||
* Constructor
|
||||
*
|
||||
**/
|
||||
CGame::CGame(bool replayLog):
|
||||
CGame::CGame(bool replayLog, const bool oosLog):
|
||||
m_World(new CWorld(*this)),
|
||||
m_Simulation2{new CSimulation2{&m_World->GetUnitManager(), *g_ScriptContext, &m_World->GetTerrain()}},
|
||||
m_Simulation2{new CSimulation2{&m_World->GetUnitManager(), *g_ScriptContext, &m_World->GetTerrain(),
|
||||
oosLog}},
|
||||
// TODO: we need to remove that global dependency. Maybe the game view
|
||||
// should be created outside only if needed.
|
||||
m_GameView(CRenderer::IsInitialised() ? new CGameView(g_VideoMode.GetBackendDevice(), this) : nullptr),
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ class CGame
|
||||
CTurnManager* m_TurnManager;
|
||||
|
||||
public:
|
||||
CGame(bool replayLog);
|
||||
CGame(bool replayLog, const bool oosLog = false);
|
||||
~CGame();
|
||||
|
||||
/**
|
||||
|
||||
@@ -249,13 +249,11 @@ void CReplayPlayer::Replay(const bool serializationtest, const int rejointesttur
|
||||
MountMods(Paths(g_CmdLineArgs), g_Mods.GetEnabledMods());
|
||||
}
|
||||
|
||||
g_Game = new CGame(false);
|
||||
g_Game = new CGame(false, ooslog);
|
||||
if (serializationtest)
|
||||
g_Game->GetSimulation2()->EnableSerializationTest();
|
||||
if (rejointestturn >= 0)
|
||||
g_Game->GetSimulation2()->EnableRejoinTest(rejointestturn);
|
||||
if (ooslog)
|
||||
g_Game->GetSimulation2()->EnableOOSLog();
|
||||
|
||||
ScriptRequest rq(g_Game->GetSimulation2()->GetScriptInterface());
|
||||
JS::RootedValue attribs(rq.cx);
|
||||
|
||||
Reference in New Issue
Block a user