diff --git a/doc/040_cvarlist.md b/doc/040_cvarlist.md index feef65af..6c41173e 100644 --- a/doc/040_cvarlist.md +++ b/doc/040_cvarlist.md @@ -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 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. The client framerate is fixed, the renderer framerate is variable. This makes it possible to renderer as many frames as desired without diff --git a/src/client/cl_entities.c b/src/client/cl_entities.c index cd8d4949..0a9cdee6 100644 --- a/src/client/cl_entities.c +++ b/src/client/cl_entities.c @@ -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], - ps->kick_angles[i], lerp); + for (i = 0; i < 3; i++) + { + 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); diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 7fc1e6df..c02bd929 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -48,6 +48,7 @@ cvar_t *cl_add_particles; cvar_t *cl_add_lights; cvar_t *cl_add_entities; cvar_t *cl_add_blend; +cvar_t *cl_anglekicks; cvar_t *cl_shownet; cvar_t *cl_showmiss; @@ -492,6 +493,7 @@ CL_InitLocal(void) cl_add_lights = Cvar_Get("cl_lights", "1", 0); cl_add_particles = Cvar_Get("cl_particles", "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_footsteps = Cvar_Get("cl_footsteps", "1", 0); cl_noskins = Cvar_Get("cl_noskins", "0", 0); @@ -659,6 +661,7 @@ cheatvar_t cheatvars[] = { {"sw_draworder", "0"}, {"gl_lightmap", "0"}, {"gl_saturatelighting", "0"}, + {"cl_anglekicks", "1"}, {NULL, NULL} }; diff --git a/src/client/header/client.h b/src/client/header/client.h index 4b2f59f6..37234f4d 100644 --- a/src/client/header/client.h +++ b/src/client/header/client.h @@ -308,6 +308,7 @@ extern cvar_t *cl_vwep; extern cvar_t *horplus; extern cvar_t *cin_force43; extern cvar_t *vid_fullscreen; +extern cvar_t *cl_anglekicks; typedef struct {