mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Readd round start tick to the calculation
This commit is contained in:
parent
e25ecef906
commit
30d089b45c
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue