mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58: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)
|
if(pItem->m_Version < 2 || pItem->m_Synchronized)
|
||||||
{
|
{
|
||||||
// get the lerp of the current tick and prev
|
// 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>(
|
s_Time = (int64)(mix<double>(
|
||||||
0,
|
0,
|
||||||
(pThis->Client()->GameTick(g_Config.m_ClDummy) - MinTick),
|
(CurTick - MinTick),
|
||||||
pThis->Client()->IntraGameTick(g_Config.m_ClDummy)) *
|
pThis->Client()->IntraGameTick(g_Config.m_ClDummy)) *
|
||||||
TickToMicroSeconds) +
|
TickToMicroSeconds) +
|
||||||
MinTick * 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))
|
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
|
// 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>(
|
s_Time = (int64)(mix<double>(
|
||||||
0,
|
0,
|
||||||
(pThis->Client()->GameTick(g_Config.m_ClDummy) - MinTick),
|
(CurTick - MinTick),
|
||||||
pThis->Client()->IntraGameTick(g_Config.m_ClDummy)) *
|
pThis->Client()->IntraGameTick(g_Config.m_ClDummy)) *
|
||||||
TickToMicroSeconds) +
|
TickToMicroSeconds) +
|
||||||
MinTick * TickToMicroSeconds;
|
MinTick * TickToMicroSeconds;
|
||||||
|
|
Loading…
Reference in a new issue