Ticket #3309: t3309_cap_expected_simTime_v3_for_singleplayer_and_replays.patch

File t3309_cap_expected_simTime_v3_for_singleplayer_and_replays.patch, 943 bytes (added by elexis, 9 years ago)

Same thing but only for singleplayer and replays. Limits the current gamespeed by the selected gamespeed.

  • source/network/NetTurnManager.cpp

    bool CNetTurnManager::WillUpdate(float s  
    102102
    103103bool CNetTurnManager::Update(float simFrameLength, size_t maxTurns)
    104104{
    105105    m_DeltaSimTime += simFrameLength;
    106106
     107    // If the game runs slower than the game speed dictates, m_DeltaSimTime increases progressively.
     108    // The engine will try to fast forward accordingly to catch up. TODO: We fix it for singleplayer
     109    // and replays until we are certain that it works for multiplayer too.
     110    if (!g_NetClient && !g_NetServer)
     111        m_DeltaSimTime = std::min(m_DeltaSimTime, simFrameLength);
     112
    107113    // If we haven't reached the next turn yet, do nothing
    108114    if (m_DeltaSimTime < 0)
    109115        return false;
    110116
    111117    NETTURN_LOG((L"Update current=%d ready=%d\n", m_CurrentTurn, m_ReadyTurn));