1
0
forked from 0ad/0ad

Fix #3309 by capping m_DeltaSimTime in NetTurnManager.cpp. Patch by elexis. Review by Philip.

This was SVN commit r17159.
This commit is contained in:
JoshuaJB 2015-10-31 21:04:47 +00:00
parent 6acfec0f44
commit a6111ff8b7

View File

@ -104,6 +104,11 @@ bool CNetTurnManager::Update(float simFrameLength, size_t maxTurns)
{
m_DeltaSimTime += simFrameLength;
// If the game becomes laggy, m_DeltaSimTime increases progressively.
// The engine will fast forward accordingly to catch up.
// To keep the game playable, stop fast forwarding after 2 turn lengths.
m_DeltaSimTime = std::min(m_DeltaSimTime, 2.0f * m_TurnLength / 1000.0f);
// If we haven't reached the next turn yet, do nothing
if (m_DeltaSimTime < 0)
return false;