From e6ce44fde72e73cb05a217ce0ef62ec9a23f38e9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 1 Jun 2012 08:17:24 +0900 Subject: [PATCH] Change qw's punchangle to a vector. Consistency with nq :) (however, only pitch works in qw). --- qw/include/client.h | 2 +- qw/source/cl_parse.c | 4 ++-- qw/source/cl_view.c | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/qw/include/client.h b/qw/include/client.h index c5ede3b0d..9fce834d2 100644 --- a/qw/include/client.h +++ b/qw/include/client.h @@ -224,7 +224,7 @@ typedef struct { vec3_t simvel; vec3_t simangles; - float punchangle; // temporary view kick from weapon firing + vec3_t punchangle; // temporary view kick from weapon firing // pitch drifting vars float idealpitch; diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 1fbd55cc6..473801ab7 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -1584,11 +1584,11 @@ CL_ParseServerMessage (void) // svc_cutscene (same value as svc_smallkick) case svc_smallkick: - cl.punchangle = -2; + cl.punchangle[PITCH] = -2; break; case svc_bigkick: - cl.punchangle = -4; + cl.punchangle[PITCH] = -4; break; case svc_updateping: diff --git a/qw/source/cl_view.c b/qw/source/cl_view.c index 97b85a140..48fef96eb 100644 --- a/qw/source/cl_view.c +++ b/qw/source/cl_view.c @@ -657,7 +657,8 @@ V_CalcRefdef (void) view->skin = 0; // set up the refresh position - r_data->refdef->viewangles[PITCH] += cl.punchangle; + VectorAdd (r_data->refdef->viewangles, cl.punchangle, + r_data->refdef->viewangles); // smooth out stair step ups if ((cl.onground != -1) && (cl.simorg[2] - oldz > 0)) { @@ -683,9 +684,9 @@ V_CalcRefdef (void) static void DropPunchAngle (void) { - cl.punchangle -= 10 * host_frametime; - if (cl.punchangle < 0) - cl.punchangle = 0; + cl.punchangle[PITCH] -= 10 * host_frametime; + if (cl.punchangle[PITCH] < 0) + cl.punchangle[PITCH] = 0; } /*