From d3dba792b109c008644620d345d867f847af86bb Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 21 Jul 2022 17:46:05 +0300 Subject: [PATCH] Fix client event angles (#290) --- cl_dll/com_weapons.cpp | 2 +- cl_dll/com_weapons.h | 1 + cl_dll/view.cpp | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cl_dll/com_weapons.cpp b/cl_dll/com_weapons.cpp index 4b9ae338..854f8689 100644 --- a/cl_dll/com_weapons.cpp +++ b/cl_dll/com_weapons.cpp @@ -137,7 +137,7 @@ void HUD_PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short event // Weapon prediction events are assumed to occur at the player's origin org = g_finalstate->playerstate.origin; - ang = v_angles; + ang = v_client_aimangles; gEngfuncs.pfnPlaybackEvent( flags, pInvoker, eventindex, delay, org, ang, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2 ); } diff --git a/cl_dll/com_weapons.h b/cl_dll/com_weapons.h index 89fb3cfe..349a848d 100644 --- a/cl_dll/com_weapons.h +++ b/cl_dll/com_weapons.h @@ -39,6 +39,7 @@ extern cvar_t *cl_lw; extern int g_runfuncs; extern vec3_t v_angles; +extern vec3_t v_client_aimangles; extern float g_lastFOV; extern struct local_state_s *g_finalstate; #endif diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index fdbee778..6c9a1582 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -88,6 +88,7 @@ float v_cameraFocusAngle = 35.0f; int v_cameraMode = CAM_MODE_FOCUS; qboolean v_resetCamera = 1; +vec3_t v_client_aimangles; vec3_t g_ev_punchangle; cvar_t *scr_ofsx; @@ -724,6 +725,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) // Store off v_angles before munging for third person v_angles = pparams->viewangles; + v_client_aimangles = pparams->cl_viewangles; v_lastAngles = pparams->viewangles; //v_cl_angles = pparams->cl_viewangles; // keep old user mouse angles ! if( CL_IsThirdPerson() )