MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetPredictionTick

Method GetPredictionTick

src/engine/client/client.cpp:5105–5132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5103}
5104
5105int CClient::GetPredictionTick()
5106{
5107 int PredictionTick = GetPredictionTime() * GameTickSpeed() / 1000.0f;
5108
5109 int PredictionMin = g_Config.m_ClAntiPingLimit * GameTickSpeed() / 1000.0f;
5110
5111 if(g_Config.m_ClAntiPingLimit == 0)
5112 {
5113 float PredictionPercentage = 1 - g_Config.m_ClAntiPingPercent / 100.0f;
5114 PredictionMin = std::floor(PredictionTick * PredictionPercentage);
5115 }
5116
5117 if(PredictionMin > PredictionTick - 1)
5118 {
5119 PredictionMin = PredictionTick - 1;
5120 }
5121
5122 if(PredictionMin <= 0)
5123 return PredGameTick(g_Config.m_ClDummy);
5124
5125 PredictionTick = PredGameTick(g_Config.m_ClDummy) - PredictionMin;
5126
5127 if(PredictionTick < GameTick(g_Config.m_ClDummy) + 1)
5128 {
5129 PredictionTick = GameTick(g_Config.m_ClDummy) + 1;
5130 }
5131 return PredictionTick;
5132}
5133
5134void CClient::GetSmoothTick(int *pSmoothTick, float *pSmoothIntraTick, float MixAmount)
5135{

Callers 4

OnPredictMethod · 0.80
RenderProjectileMethod · 0.80
RenderLaserMethod · 0.80
ReconstructSmokeTrailMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected