From b289de26a6a21f911e31e592149070c95b6e50b0 Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Tue, 4 May 2021 13:11:55 +0400 Subject: [PATCH] engine: client: added cvar cl_nointerp for disabling interpolation --- engine/client/cl_frame.c | 10 ++++++++++ engine/client/cl_main.c | 4 +++- engine/client/client.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/engine/client/cl_frame.c b/engine/client/cl_frame.c index e16eaea1..2bb6a9c2 100644 --- a/engine/client/cl_frame.c +++ b/engine/client/cl_frame.c @@ -131,6 +131,9 @@ some ents will be ignore lerping */ qboolean CL_EntityIgnoreLerp( cl_entity_t *e ) { + if( cl_nointerp->value > 0.f ) + return true; + if( e->model && e->model->type == mod_alias ) return false; @@ -529,6 +532,13 @@ void CL_ComputePlayerOrigin( cl_entity_t *ent ) if( !ent->player || ent->index == ( cl.playernum + 1 )) return; + if( cl_nointerp->value > 0.f ) + { + VectorCopy( ent->curstate.angles, ent->angles ); + VectorCopy( ent->curstate.origin, ent->origin ); + return; + } + if( cls.demoplayback == DEMO_QUAKE1 ) { // quake lerping is easy diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index d8c3bc9a..0e475b4d 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -63,6 +63,7 @@ convar_t *cl_updaterate; convar_t *cl_showevents; convar_t *cl_cmdrate; convar_t *cl_interp; +convar_t *cl_nointerp; convar_t *cl_dlmax; convar_t *cl_upmax; @@ -2844,7 +2845,8 @@ void CL_InitLocal( void ) Cvar_Get( "team", "", FCVAR_USERINFO, "player team" ); Cvar_Get( "skin", "", FCVAR_USERINFO, "player skin" ); - cl_nosmooth = Cvar_Get( "cl_nosmooth", "0", FCVAR_ARCHIVE, "disable smooth up stair climbing and interpolate position in multiplayer" ); + cl_nosmooth = Cvar_Get( "cl_nosmooth", "0", FCVAR_ARCHIVE, "disable smooth up stair climbing" ); + cl_nointerp = Cvar_Get( "cl_nointerp", "0", FCVAR_CLIENTDLL, "disable interpolation of entities and players" ); cl_smoothtime = Cvar_Get( "cl_smoothtime", "0", FCVAR_ARCHIVE, "time to smooth up" ); cl_cmdbackup = Cvar_Get( "cl_cmdbackup", "10", FCVAR_ARCHIVE, "how many additional history commands are sent" ); cl_cmdrate = Cvar_Get( "cl_cmdrate", "30", FCVAR_ARCHIVE, "Max number of command packets sent to server per second" ); diff --git a/engine/client/client.h b/engine/client/client.h index 4db8f29a..4dcdd6dd 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -658,6 +658,7 @@ extern convar_t *cl_nopred; extern convar_t *cl_timeout; extern convar_t *cl_nodelta; extern convar_t *cl_interp; +extern convar_t *cl_nointerp; extern convar_t *cl_showerror; extern convar_t *cl_nosmooth; extern convar_t *cl_smoothtime;