Readd round start tick to the calculation

This commit is contained in:
Jupeyy 2020-12-29 03:08:28 +01:00
parent e25ecef906
commit 30d089b45c

View file

@ -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<double>(
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<double>(
0,
(pThis->Client()->GameTick(g_Config.m_ClDummy) - MinTick),
(CurTick - MinTick),
pThis->Client()->IntraGameTick(g_Config.m_ClDummy)) *
TickToMicroSeconds) +
MinTick * TickToMicroSeconds;