]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - view.c
significant cleanup of CL_UpdateEntities, GL_UpdateNetworkEntity, CL_LinkNetworkEntit...
[xonotic/darkplaces.git] / view.c
diff --git a/view.c b/view.c
index 737cfdd4b36891de66d9cc2d3727bf92a62e4b3d..c3ccb51fc12c5b060582f190c98ef4ee7d32ea49 100644 (file)
--- a/view.c
+++ b/view.c
@@ -322,17 +322,17 @@ CL_StairSmoothing
 void CL_StairSmoothing (void)
 {
        if (v_dmg_time > 0)
-               v_dmg_time -= (cl.time - cl.oldtime);
+               v_dmg_time -= bound(0, cl.time - cl.oldtime, 0.1);
 
        // stair smoothing
        if (cl.onground && cl.stairoffset < 0)
        {
-               cl.stairoffset += (cl.time - cl.oldtime) * cl_stairsmoothspeed.value;
+               cl.stairoffset += bound(0, cl.time - cl.oldtime, 0.1) * cl_stairsmoothspeed.value;
                cl.stairoffset = bound(-16, cl.stairoffset, 0);
        }
        else if (cl.onground && cl.stairoffset > 0)
        {
-               cl.stairoffset -= (cl.time - cl.oldtime) * cl_stairsmoothspeed.value;
+               cl.stairoffset -= bound(0, cl.time - cl.oldtime, 0.1) * cl_stairsmoothspeed.value;
                cl.stairoffset = bound(0, cl.stairoffset, 16);
        }
        else
@@ -351,8 +351,6 @@ void V_CalcRefdef (void)
        entity_t *ent;
        float vieworg[3], gunorg[3], viewangles[3];
        trace_t trace;
-       if(csqc_loaded)
-               return;
        VectorClear(gunorg);
        viewmodelmatrix = identitymatrix;
        r_view.matrix = identitymatrix;
@@ -394,7 +392,7 @@ void V_CalcRefdef (void)
                        else
                        {
                                r_view.matrix = ent->render.matrix;
-                               r_view.matrix.m[2][3] += cl.stats[STAT_VIEWHEIGHT];
+                               Matrix4x4_AdjustOrigin(&r_view.matrix, 0, 0, cl.stats[STAT_VIEWHEIGHT]);
                        }
                        viewmodelmatrix = r_view.matrix;
                }
@@ -538,6 +536,9 @@ void V_CalcRefdef (void)
 
 void V_FadeViewFlashs(void)
 {
+       // don't flash if time steps backwards
+       if (cl.time <= cl.oldtime)
+               return;
        // drop the damage value
        cl.cshifts[CSHIFT_DAMAGE].percent -= (cl.time - cl.oldtime)*150;
        if (cl.cshifts[CSHIFT_DAMAGE].percent <= 0)