diff --git a/engine/client/cl_ents.c b/engine/client/cl_ents.c index 07589a7e9..60ea8a4ba 100644 --- a/engine/client/cl_ents.c +++ b/engine/client/cl_ents.c @@ -2933,6 +2933,7 @@ void CL_LinkViewModel(void) float alpha; extern cvar_t cl_gunx, cl_guny, cl_gunz; + extern cvar_t cl_gunanglex, cl_gunangley, cl_gunanglez; #ifdef SIDEVIEWS extern qboolean r_secondaryview; @@ -2977,6 +2978,10 @@ void CL_LinkViewModel(void) ent.origin[1] = -cl_gunx.value; ent.origin[2] = -cl_guny.value; + ent.angles[0] = cl_gunanglex.value; + ent.angles[1] = cl_gunangley.value; + ent.angles[2] = cl_gunanglez.value; + ent.shaderRGBAf[0] = 1; ent.shaderRGBAf[1] = 1; ent.shaderRGBAf[2] = 1; diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index d41b632a8..7cae6063a 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -124,6 +124,10 @@ cvar_t cl_gunx = SCVAR("cl_gunx", "0"); cvar_t cl_guny = SCVAR("cl_guny", "0"); cvar_t cl_gunz = SCVAR("cl_gunz", "0"); +cvar_t cl_gunanglex = SCVAR("cl_gunanglex", "0"); +cvar_t cl_gunangley = SCVAR("cl_gunangley", "0"); +cvar_t cl_gunanglez = SCVAR("cl_gunanglez", "0"); + cvar_t allow_download_csprogs = SCVAR("allow_download_csprogs", "0"); cvar_t cl_muzzleflash = SCVAR("cl_muzzleflash", "1"); @@ -2706,6 +2710,10 @@ void CL_Init (void) Cvar_Register (&cl_guny, cl_controlgroup); Cvar_Register (&cl_gunz, cl_controlgroup); + Cvar_Register (&cl_gunanglex, cl_controlgroup); + Cvar_Register (&cl_gunangley, cl_controlgroup); + Cvar_Register (&cl_gunanglez, cl_controlgroup); + #ifdef WEBCLIENT Cmd_AddCommand ("ftp", CL_FTP_f); #endif diff --git a/engine/client/clq2_ents.c b/engine/client/clq2_ents.c index 4f1a71f5d..e839c4d7f 100644 --- a/engine/client/clq2_ents.c +++ b/engine/client/clq2_ents.c @@ -1875,9 +1875,9 @@ CL_AddViewWeapon void CLQ2_AddViewWeapon (q2player_state_t *ps, q2player_state_t *ops) { entity_t gun; // view model - int i; entity_t *view; extern cvar_t cl_gunx, cl_guny, cl_gunz; + extern cvar_t cl_gunanglex, cl_gunangley, cl_gunanglez; // allow the gun to be completely removed if (!r_drawviewmodel.value) @@ -1913,16 +1913,14 @@ void CLQ2_AddViewWeapon (q2player_state_t *ps, q2player_state_t *ops) else gun.shaderRGBAf[3] = 1; + // set up gun position gun.origin[0] = cl_gunz.value; gun.origin[1] = -cl_gunx.value; gun.origin[2] = -cl_guny.value; - // set up gun position - for (i=0 ; i<3 ; i++) - { - gun.angles[i] = 0;//LerpAngle (ops->gunangles[i], - // ps->gunangles[i], cl.lerpfrac); - } + gun.angles[0] = cl_gunanglex.value; + gun.angles[1] = cl_gunangley.value; + gun.angles[2] = cl_gunanglez.value; gun.frame = ps->gunframe; if (gun.frame == 0)