]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/csqcmodel/cl_player.qc
Remove cl_useenginerefdef and sv_qcphysics options, make the QuakeC implementations...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / csqcmodel / cl_player.qc
index acd503c5a222672078d0dd5d23f6c48126081c6c..12e47cfa67c1c837a443b3027eb5bb4ec988b4ef 100644 (file)
@@ -434,7 +434,6 @@ float autocvar_chase_back;
 float autocvar_chase_up;
 bool autocvar_chase_overhead;
 float autocvar_chase_pitchangle;
-bool autocvar_chase_front;
 vector CSQCPlayer_ApplyChase(entity this, vector v)
 {
        vector forward;
@@ -480,19 +479,28 @@ vector CSQCPlayer_ApplyChase(entity this, vector v)
        {
                makevectors(view_angles);
                forward = v_forward;
-               if(autocvar_chase_front)
+               if(autocvar_chase_front && spectatee_status != -1)
                        forward = normalize(forward * -1);
                // trace a little further so it hits a surface more consistently (to avoid 'snapping' on the edge of the range)
                float cdist = -autocvar_chase_back - 8;
                chase_dest.x = v.x + forward.x * cdist;
                chase_dest.y = v.y + forward.y * cdist;
                chase_dest.z = v.z + forward.z * cdist + autocvar_chase_up;
-               traceline(v, chase_dest, MOVE_NOMONSTERS, NULL);
+               if (this.move_movetype == MOVETYPE_NOCLIP)
+               {
+                       // as if traceline hasn't hit anything
+                       trace_endpos = chase_dest;
+                       trace_plane_normal = '0 0 0';
+               }
+               else
+               {
+                       traceline(v, chase_dest, MOVE_NOMONSTERS, NULL);
+               }
                v.x = 1 * trace_endpos.x + 8 * forward.x + 4 * trace_plane_normal.x;
                v.y = 1 * trace_endpos.y + 8 * forward.y + 4 * trace_plane_normal.y;
                v.z = 1 * trace_endpos.z + 8 * forward.z + 4 * trace_plane_normal.z;
 
-               if(autocvar_chase_front)
+               if(autocvar_chase_front && spectatee_status != -1)
                {
                        // now flip the view so the player is looking at themselves
                        vector newang = vectoangles(forward);
@@ -540,8 +548,6 @@ void CSQCPlayer_CalcRefdef(entity this)
        setproperty(VF_ANGLES, view_angles);
 }
 
-bool autocvar_cl_useenginerefdef = false;
-
 /** Called once per CSQC_UpdateView() */
 void CSQCPlayer_SetCamera()
 {
@@ -623,20 +629,7 @@ void CSQCPlayer_SetCamera()
                        InterpolateOrigin_Do(view);
                        view.view_ofs = '0 0 1' * vh;
                }
-               if(autocvar_cl_useenginerefdef)
-               {
-                       int refdefflags = 0;
-                       if (view.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
-                       if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
-                       // note: these two only work in WIP2, but are harmless in WIP1
-                       if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD;
-                       if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
-                       V_CalcRefdef(view, refdefflags); // TODO? uses .health stat in the engine when this isn't called here, may be broken!
-               }
-               else
-               {
-                       CSQCPlayer_CalcRefdef(view);
-               }
+               CSQCPlayer_CalcRefdef(view);
        }
        else
        {
@@ -668,7 +661,8 @@ bool CSQCPlayer_PostUpdate(entity this)
        if (this.entnum != player_localnum + 1) return false;
        csqcplayer = this;
        csqcplayer_status = CSQCPLAYERSTATUS_FROMSERVER;
-       cvar_settemp("cl_movement_replay", "0");
+       if (cvar("cl_movement_replay"))
+               cvar_settemp("cl_movement_replay", "0");
        this.entremove = CSQCPlayer_Remove;
        return true;
 }