Add `cl_anglekick`, when set to 0 angle kicks are ignored.

Angle kicks are used for weapon recoil, damage kicks and the like.
Setting the `cl_anglekicks` to `0` ignored them, they're read from
the network but not displayed. The cvar is cheat protected, it's
reset to `1` on server connect.

Rquested by Martin via mail.
This commit is contained in:
Yamagi 2020-08-17 14:15:14 +02:00
parent fd0c058b2e
commit 1f3f796322
4 changed files with 13 additions and 3 deletions

View File

@ -55,6 +55,9 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable`
time for the next frame. The later is more CPU friendly but rather time for the next frame. The later is more CPU friendly but rather
inaccurate, especially on Windows. Use with care. inaccurate, especially on Windows. Use with care.
* **cl_anglekicks**: If set to `0` angle kicks (weapon recoil, damage
hits and the like) are ignored. Cheat protected. Defaults to `1`.
* **cl_async**: If set to `1` (the default) the client is asynchronous. * **cl_async**: If set to `1` (the default) the client is asynchronous.
The client framerate is fixed, the renderer framerate is variable. The client framerate is fixed, the renderer framerate is variable.
This makes it possible to renderer as many frames as desired without This makes it possible to renderer as many frames as desired without

View File

@ -757,10 +757,13 @@ CL_CalcViewValues(void)
} }
} }
for (i = 0; i < 3; i++) if (cl_anglekicks->value)
{ {
cl.refdef.viewangles[i] += LerpAngle(ops->kick_angles[i], for (i = 0; i < 3; i++)
ps->kick_angles[i], lerp); {
cl.refdef.viewangles[i] += LerpAngle(ops->kick_angles[i],
ps->kick_angles[i], lerp);
}
} }
AngleVectors(cl.refdef.viewangles, cl.v_forward, cl.v_right, cl.v_up); AngleVectors(cl.refdef.viewangles, cl.v_forward, cl.v_right, cl.v_up);

View File

@ -48,6 +48,7 @@ cvar_t *cl_add_particles;
cvar_t *cl_add_lights; cvar_t *cl_add_lights;
cvar_t *cl_add_entities; cvar_t *cl_add_entities;
cvar_t *cl_add_blend; cvar_t *cl_add_blend;
cvar_t *cl_anglekicks;
cvar_t *cl_shownet; cvar_t *cl_shownet;
cvar_t *cl_showmiss; cvar_t *cl_showmiss;
@ -492,6 +493,7 @@ CL_InitLocal(void)
cl_add_lights = Cvar_Get("cl_lights", "1", 0); cl_add_lights = Cvar_Get("cl_lights", "1", 0);
cl_add_particles = Cvar_Get("cl_particles", "1", 0); cl_add_particles = Cvar_Get("cl_particles", "1", 0);
cl_add_entities = Cvar_Get("cl_entities", "1", 0); cl_add_entities = Cvar_Get("cl_entities", "1", 0);
cl_anglekicks = Cvar_Get("cl_anglekicks", "1", 0);
cl_gun = Cvar_Get("cl_gun", "2", CVAR_ARCHIVE); cl_gun = Cvar_Get("cl_gun", "2", CVAR_ARCHIVE);
cl_footsteps = Cvar_Get("cl_footsteps", "1", 0); cl_footsteps = Cvar_Get("cl_footsteps", "1", 0);
cl_noskins = Cvar_Get("cl_noskins", "0", 0); cl_noskins = Cvar_Get("cl_noskins", "0", 0);
@ -659,6 +661,7 @@ cheatvar_t cheatvars[] = {
{"sw_draworder", "0"}, {"sw_draworder", "0"},
{"gl_lightmap", "0"}, {"gl_lightmap", "0"},
{"gl_saturatelighting", "0"}, {"gl_saturatelighting", "0"},
{"cl_anglekicks", "1"},
{NULL, NULL} {NULL, NULL}
}; };

View File

@ -308,6 +308,7 @@ extern cvar_t *cl_vwep;
extern cvar_t *horplus; extern cvar_t *horplus;
extern cvar_t *cin_force43; extern cvar_t *cin_force43;
extern cvar_t *vid_fullscreen; extern cvar_t *vid_fullscreen;
extern cvar_t *cl_anglekicks;
typedef struct typedef struct
{ {