From: divverent Date: Tue, 31 Oct 2017 18:50:09 +0000 (+0000) Subject: Fix initialization of gunorg/vieworg when cl_followmodel/cl_leanmodel are disabled. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b525495b9939e6aec1fb8a44ebf0976589d26038;p=xonotic%2Fdarkplaces.git 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 --- 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);