From 1b8162a4b678666f0c19fed8391ebaf4c0455138 Mon Sep 17 00:00:00 2001 From: Kamay Xutax Date: Tue, 23 Jan 2024 14:38:19 +0100 Subject: [PATCH] Remove latency checks on lag compensation --- game/server/player_lagcompensation.cpp | 29 -------------------------- 1 file changed, 29 deletions(-) diff --git a/game/server/player_lagcompensation.cpp b/game/server/player_lagcompensation.cpp index fcee4bbc42..3a7f41237f 100644 --- a/game/server/player_lagcompensation.cpp +++ b/game/server/player_lagcompensation.cpp @@ -362,40 +362,11 @@ void CLagCompensationManager::StartLagCompensation( CBasePlayer *player, CUserCm Q_memset( m_RestoreData, 0, sizeof( m_RestoreData ) ); Q_memset( m_ChangeData, 0, sizeof( m_ChangeData ) ); - // Get true latency - - // correct is the amout of time we have to correct game time - float correct = 0.0f; - - INetChannelInfo *nci = engine->GetPlayerNetInfo( player->entindex() ); - - if ( nci ) - { - // add network latency - correct+= nci->GetLatency( FLOW_OUTGOING ); - } - // calc number of view interpolation ticks - 1 int lerpTicks = TIME_TO_TICKS( player->m_fLerpTime ); - // add view interpolation latency see C_BaseEntity::GetInterpolationAmount() - correct += TICKS_TO_TIME( lerpTicks ); - - // check bouns [0,sv_maxunlag] - correct = clamp( correct, 0.0f, sv_maxunlag.GetFloat() ); - // correct tick send by player int targettick = cmd->tick_count - lerpTicks; - - // calc difference between tick send by player and our latency based tick - float deltaTime = correct - TICKS_TO_TIME(gpGlobals->tickcount - targettick); - - if ( fabs( deltaTime ) > 0.2f ) - { - // difference between cmd time and latency is too big > 200ms, use time correction based on latency - // DevMsg("StartLagCompensation: delta too big (%.3f)\n", deltaTime ); - targettick = gpGlobals->tickcount - TIME_TO_TICKS( correct ); - } // Iterate all active players const CBitVec *pEntityTransmitBits = engine->GetEntityTransmitBitsForClient( player->entindex() - 1 );