From 58dcc234b875e3b119fe40ebbea90224c9959e6d Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 27 May 2011 21:05:32 +0200 Subject: [PATCH] make event chase cam warpzone aware (PLEASE TEST) --- qcsrc/client/View.qc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 898812990..6c6ab2aaa 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -447,13 +447,14 @@ void CSQC_UpdateView(float w, float h) // pass 1, used to check where the camera would go and obtain the trace_fraction eventchase_target_origin = pmove_org - v_forward * eventchase_current_distance; - traceline(pmove_org, eventchase_target_origin, MOVE_WORLDONLY, self); + WarpZone_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 - v_forward * eventchase_current_distance * (trace_fraction - 0.1); + WarpZone_TraceLine(pmove_org, eventchase_target_origin, MOVE_WORLDONLY, self); - R_SetView(VF_ORIGIN, eventchase_target_origin); - R_SetView(VF_ANGLES, view_angles); + R_SetView(VF_ORIGIN, trace_endpos); + R_SetView(VF_ANGLES, WarpZone_TransformVAngles(WarpZone_trace_transform, view_angles)); } else if(autocvar_chase_active < 0) // time to disable chase_active if it was set by this code { -- 2.39.2