]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix initialization of gunorg/vieworg when cl_followmodel/cl_leanmodel are disabled.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 31 Oct 2017 18:50:09 +0000 (18:50 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 31 Oct 2017 18:50:09 +0000 (18:50 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12342 d7cf8633-e32d-0410-b094-e92efae38249

view.c

diff --git a/view.c b/view.c
index da8023961268e447a8e7c6dc2954ac8e3395901f..1102effb30463628974b4503f832bd6f4e212e37 100644 (file)
--- 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;
 
 
                                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)
                                {
                                        // 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);
                                }
                                        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);
 
                                // 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);