]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use v_forward instead of view_forward
authorSamual <samual@xonotic.org>
Thu, 21 Apr 2011 02:08:49 +0000 (22:08 -0400)
committerSamual <samual@xonotic.org>
Thu, 21 Apr 2011 02:08:49 +0000 (22:08 -0400)
view_forward isn't updated in the code by the time the chasecam code is called, so instead use the real source for it and it is updated at the proper time. Note: Should the order of the code be changed instead? I think this should be fine though.

qcsrc/client/View.qc

index 27075599b3ec6a2d9011bd54a840d529d50944ca..0da6406195bc955b32298dc81dd9c385e2fdebf3 100644 (file)
@@ -443,12 +443,12 @@ void CSQC_UpdateView(float w, float h)
                        vector eventchase_target_origin;
                        makevectors(view_angles);
                        // pass 1, used to check where the camera would go and obtain the trace_fraction
-                       eventchase_target_origin = pmove_org - view_forward * eventchase_current_distance;
+                       eventchase_target_origin = pmove_org - v_forward * eventchase_current_distance;
 
                        traceline(pmove_org, eventchase_target_origin, MOVE_WORLDONLY, self);
                        // pass 2, also multiplying view_forward with trace_fraction, to prevent the camera from going through walls
                        // The 0.1 subtraction is to not limit the camera precisely at the wall surface, as that allows the view to poke through
-                       eventchase_target_origin = pmove_org - view_forward * eventchase_current_distance * (trace_fraction - 0.1);
+                       eventchase_target_origin = pmove_org - v_forward * eventchase_current_distance * (trace_fraction - 0.1);
 
                        R_SetView(VF_ORIGIN, eventchase_target_origin);
                }