From b95f1f3c76460362b51d7c3b0d471df9a53069b3 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 26 May 2007 00:39:03 +0000 Subject: [PATCH] Fixed Molgrum's speed cheat. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2504 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_input.c | 14 ++++++++++---- engine/client/client.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/engine/client/cl_input.c b/engine/client/cl_input.c index d385dbbd..300e1ee5 100644 --- a/engine/client/cl_input.c +++ b/engine/client/cl_input.c @@ -1088,7 +1088,7 @@ CL_SendCmd ================= */ vec3_t accum[MAX_SPLITS]; -void CL_SendCmd (float frametime) +void CL_SendCmd (double frametime) { extern cvar_t cl_indepphysics; sizebuf_t buf; @@ -1105,7 +1105,7 @@ void CL_SendCmd (float frametime) static float pps_balance = 0; static int dropcount = 0; - static float msecs; + static double msecs; int msecstouse; qboolean dontdrop=false; @@ -1229,15 +1229,21 @@ void CL_SendCmd (float frametime) } if (cl_netfps.value && !cl_indepphysics.value) - { + {//this chunk of code is here to stop the client from using too few msecs per packet int spare; spare = CL_FilterTime(msecstouse, cl_netfps.value<=0?cl_maxfps.value:cl_netfps.value); if (!spare && msecstouse<255 && cls.state == ca_active) { return; } + if (spare > 10) + spare = 10; if (spare > 0) + { msecstouse -= spare; + for (plnum = 0; plnum < cl.splitclients; plnum++) + independantphysics[plnum].msec = msecstouse; + } } #ifdef NQPROT @@ -1326,7 +1332,7 @@ void CL_SendCmd (float frametime) lightlev = 0; } - msecs -= msecstouse; + msecs = msecs - (double)msecstouse; firstsize=0; for (plnum = 0; plnum