From 60e15c98ee9e2edc01af7ea55599aceb40402732 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 3 Dec 2018 22:11:47 +0300 Subject: [PATCH] Enable camera rotation on death in Gold Source --- cl_dll/input_goldsource.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index c45841cb..25612592 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -161,6 +161,7 @@ bool isMouseRelative = false; extern globalvars_t *gpGlobals; #endif +int CL_IsDead( void ); extern Vector dead_viewangles; void V_StopPitchDrift( void ) @@ -823,7 +824,17 @@ void GoldSourceInput::IN_MouseMove ( float frametime, usercmd_t *cmd) int mx, my; vec3_t viewangles; - gEngfuncs.GetViewAngles( (float *)viewangles ); + if( gHUD.m_iIntermission ) + return; // we can't move during intermission + + if( CL_IsDead() ) + { + viewangles = dead_viewangles; // HACKHACK: see below + } + else + { + gEngfuncs.GetViewAngles( viewangles ); + } if ( in_mlook.state & 1) { @@ -880,8 +891,14 @@ void GoldSourceInput::IN_MouseMove ( float frametime, usercmd_t *cmd) } } - gEngfuncs.SetViewAngles( (float *)viewangles ); + // HACKHACK: change viewangles directly in viewcode, + // so viewangles when player is dead will not be changed on server + if( !CL_IsDead() ) + { + gEngfuncs.SetViewAngles( viewangles ); + } + dead_viewangles = viewangles; // keep them actual /* //#define TRACE_TEST #if defined( TRACE_TEST )