LagCompensation: fix turning off lagcomp

This commit is contained in:
BotoX 2020-01-04 17:55:34 +01:00
parent 7c23a2c6e8
commit 26cb622fab

View File

@ -763,15 +763,18 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
if(!IsPlayerAlive(client))
return Plugin_Continue;
if(g_bDisableLagComp[client])
return Plugin_Continue;
// -1 because the newest record in the list is one tick old
// this is because we simulate players first
// hence no new entity record was inserted on the current tick
int iGameTick = GetGameTickCount() - 1;
int iDelta = iGameTick - tickcount;
// The user is stupid and doesn't want lag compensation.
// To get the original behavior back lets assume they actually have 0 latency.
if(g_bDisableLagComp[client])
iDelta = 0;
if(iDelta < 0)
iDelta = 0;