1
0
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:
phosit
2025-10-15 10:58:33 +02:00
parent 0fe18e1d84
commit 10afb7d856
5 changed files with 13 additions and 23 deletions
+3 -2
View File
@@ -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
View File
@@ -88,7 +88,7 @@ class CGame
CTurnManager* m_TurnManager;
public:
CGame(bool replayLog);
CGame(bool replayLog, const bool oosLog = false);
~CGame();
/**
+1 -3
View File
@@ -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);