]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Actually, rework that last commit a bit
authorSamual Lenks <samual@xonotic.org>
Tue, 13 Aug 2013 21:58:05 +0000 (17:58 -0400)
committerSamual Lenks <samual@xonotic.org>
Tue, 13 Aug 2013 21:58:05 +0000 (17:58 -0400)
qcsrc/client/View.qc

index 5d5f28789e0449dd846777465d6174db501dc1f6..44f8236f2f55cb859b9a04e3b5eff1d58567c433 100644 (file)
@@ -486,13 +486,12 @@ void CSQC_UpdateView(float w, float h)
                        vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org);
 
                        // detect maximum viewoffset and use it
-                       WarpZone_TraceLine(current_view_origin, current_view_origin + autocvar_cl_eventchase_viewoffset + ('0 0 1' * autocvar_cl_eventchase_maxs_z), MOVE_WORLDONLY, self);
-                       current_view_origin_z +=
-                               max(0,
-                                       (trace_fraction * autocvar_cl_eventchase_viewoffset_z)
-                                       -
-                                       autocvar_cl_eventchase_maxs_z
-                               );
+                       if(autocvar_cl_eventchase_viewoffset)
+                       {
+                               WarpZone_TraceLine(current_view_origin, current_view_origin + autocvar_cl_eventchase_viewoffset + ('0 0 1' * autocvar_cl_eventchase_maxs_z), MOVE_WORLDONLY, self);
+                               if(trace_fraction == 1) { current_view_origin += autocvar_cl_eventchase_viewoffset; }
+                               else { current_view_origin_z += max(0, (trace_endpos_z - current_view_origin_z) - autocvar_cl_eventchase_maxs_z); }
+                       }
 
                        // We must enable chase_active to get a third person view (weapon viewmodel hidden and own player model showing).
                        // Ideally, there should be another way to enable third person cameras, such as through setproperty()