From b525495b9939e6aec1fb8a44ebf0976589d26038 Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 31 Oct 2017 18:50:09 +0000 Subject: [PATCH] Fix initialization of gunorg/vieworg when cl_followmodel/cl_leanmodel are disabled. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12342 d7cf8633-e32d-0410-b094-e92efae38249 --- view.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/view.c b/view.c index da802396..1102effb 100644 --- a/view.c +++ b/view.c @@ -670,7 +670,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa frametime = (cl.time - cl.calcrefdef_prevtime) * cl.movevars_timescale; - if(cl_followmodel.value || cl_leanmodel.value) + if(cl_followmodel.integer || cl_leanmodel.integer) { // 1. if we teleported, clear the frametime... the lowpass will recover the previous value then if(teleported) @@ -717,6 +717,12 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa VectorAdd(vieworg, gunorg, gunorg); VectorAdd(viewangles, gunangles, gunangles); } + else + { + // Just initialize gunorg/gunangles. + VectorCopy(vieworg, gunorg); + VectorCopy(viewangles, gunangles); + } // bounded XY speed, used by several effects below xyspeed = bound (0, sqrt(clvelocity[0]*clvelocity[0] + clvelocity[1]*clvelocity[1]), cl_bob_velocity_limit.value); -- 2.39.2