mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-13 15:34:37 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user