1
0
forked from 0ad/0ad

Reliably send the ReplayFinished message at the very end of visual replays. Patch by elexis.

This was SVN commit r16902.
This commit is contained in:
Nicolas Auvray 2015-07-30 21:55:34 +00:00
parent a4e606c575
commit 1a8096a920
2 changed files with 4 additions and 3 deletions

View File

@ -549,6 +549,9 @@ void CNetReplayTurnManager::DoTurn(u32 turn)
m_Simulation2.GetScriptInterface().ParseJSON(pair.second, &command);
AddCommand(m_ClientId, pair.first, command, m_CurrentTurn + 1);
}
if (turn == m_FinalReplayTurn)
g_GUI->SendEventToAll("ReplayFinished");
}
CNetServerTurnManager::CNetServerTurnManager(CNetServerWorker& server) :

View File

@ -389,12 +389,10 @@ bool CGame::Update(const double deltaRealTime, bool doInterpolate)
PROFILE3("gui sim update");
g_GUI->SendEventToAll("SimulationUpdate");
}
if (m_IsReplay && m_TurnManager->GetCurrentTurn() == m_FinalReplayTurn - 1)
g_GUI->SendEventToAll("ReplayFinished");
GetView()->GetLOSTexture().MakeDirty();
}
if (CRenderer::IsInitialised())
g_Renderer.GetTimeManager().Update(deltaSimTime);
}