From 26cb622fabb553575bf545cf9a6e8c814bf4111f Mon Sep 17 00:00:00 2001 From: BotoX Date: Sat, 4 Jan 2020 17:55:34 +0100 Subject: [PATCH] LagCompensation: fix turning off lagcomp --- LagCompensation/scripting/LagCompensation.sp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/LagCompensation/scripting/LagCompensation.sp b/LagCompensation/scripting/LagCompensation.sp index 87ae31ca..f544a588 100644 --- a/LagCompensation/scripting/LagCompensation.sp +++ b/LagCompensation/scripting/LagCompensation.sp @@ -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;