From 30d089b45c772d31b207a1d0a3121d1b6481422d Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Tue, 29 Dec 2020 03:08:28 +0100 Subject: [PATCH] Readd round start tick to the calculation --- src/game/client/components/maplayers.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/maplayers.cpp b/src/game/client/components/maplayers.cpp index b885853bd..8717718f5 100644 --- a/src/game/client/components/maplayers.cpp +++ b/src/game/client/components/maplayers.cpp @@ -102,10 +102,11 @@ void CMapLayers::EnvelopeEval(int TimeOffsetMillis, int Env, float *pChannels, v if(pItem->m_Version < 2 || pItem->m_Synchronized) { // get the lerp of the current tick and prev - int MinTick = pThis->Client()->PrevGameTick(g_Config.m_ClDummy); + int MinTick = pThis->Client()->PrevGameTick(g_Config.m_ClDummy) - pThis->m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick; + int CurTick = pThis->Client()->GameTick(g_Config.m_ClDummy) - pThis->m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick; s_Time = (int64)(mix( 0, - (pThis->Client()->GameTick(g_Config.m_ClDummy) - MinTick), + (CurTick - MinTick), pThis->Client()->IntraGameTick(g_Config.m_ClDummy)) * TickToMicroSeconds) + MinTick * TickToMicroSeconds; @@ -129,10 +130,11 @@ void CMapLayers::EnvelopeEval(int TimeOffsetMillis, int Env, float *pChannels, v if(pThis->m_pClient->m_Snap.m_pGameInfoObj) // && !(pThis->m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_PAUSED)) { // get the lerp of the current tick and prev - int MinTick = pThis->Client()->PrevGameTick(g_Config.m_ClDummy); + int MinTick = pThis->Client()->PrevGameTick(g_Config.m_ClDummy) - pThis->m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick; + int CurTick = pThis->Client()->GameTick(g_Config.m_ClDummy) - pThis->m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick; s_Time = (int64)(mix( 0, - (pThis->Client()->GameTick(g_Config.m_ClDummy) - MinTick), + (CurTick - MinTick), pThis->Client()->IntraGameTick(g_Config.m_ClDummy)) * TickToMicroSeconds) + MinTick * TickToMicroSeconds;