]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/View.qc
A slightly better way of sticking the camera above the ground. Still bad though,...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / View.qc
index 8420139180a1a2268654b57c77d476e7e42d9ef9..c0bf17c6101dd5866b07e9e454614fb7529ad485 100644 (file)
@@ -367,6 +367,7 @@ float contentavgalpha, liquidalpha_prev;
 vector liquidcolor_prev;
 
 float chase_current_distance;
+vector chase_old_origin;
 
 void CSQC_UpdateView(float w, float h)
 {
@@ -421,16 +422,19 @@ void CSQC_UpdateView(float w, float h)
                        else if(chase_current_distance != autocvar_cl_chase_distance)
                                chase_current_distance = autocvar_cl_chase_distance;
 
-                       vector target_origin;
-                       target_origin = pmove_org - view_forward * chase_current_distance;
+                       vector chase_target_origin;
+                       makevectors(view_angles);
+                       chase_target_origin = pmove_org - view_forward * chase_current_distance;
 
                        // don't allow the camera to go through walls
-                       traceline(pmove_org, target_origin, MOVE_NORMAL, self);
+                       traceline(pmove_org, chase_target_origin, MOVE_NORMAL, self);
                        if(trace_fraction == 1)
                        {
-                               makevectors(view_angles);
-                               R_SetView(VF_ORIGIN, target_origin);
+                               R_SetView(VF_ORIGIN, chase_target_origin);
+                               chase_old_origin = chase_target_origin;
                        }
+                       else
+                               R_SetView(VF_ORIGIN, chase_old_origin);
                }
                else if(autocvar_chase_active < 0)
                {
@@ -451,7 +455,7 @@ void CSQC_UpdateView(float w, float h)
        freeze_input_angles = input_angles;
 
        // Render the Scene
-       if(!intermission || !view_set)
+       if(!intermission || !view_set || (intermission && autocvar_cl_chase_intermission))
        {
                view_origin = pmove_org + vo;
                view_angles = input_angles;