]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
dpdefs: lots of improvements
[xonotic/darkplaces.git] / cl_main.c
index 9071b890de7fc6ce4cf0384be7067a22763f60a9..327a2f7853c51bba602fe99d9b12255a13866582 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -509,6 +509,8 @@ static void CL_ModelIndexList_f(void)
        for (i = -MAX_MODELS;i < MAX_MODELS;i++)
        {
                model = CL_GetModelByIndex(i);
+               if (!model)
+                       continue;
                if(model->loaded || i == 1)
                        Con_Printf("%3i: %-30s %-8s %-10i\n", i, model->name, model->modeldatatypestring, model->surfmesh.num_triangles);
                else
@@ -1257,7 +1259,8 @@ static void CL_UpdateNetworkEntityTrail(entity_t *e)
                if (len > 0)
                        len = 1.0f / len;
                VectorScale(vel, len, vel);
-               CL_ParticleTrail(trailtype, 1, e->persistent.trail_origin, origin, vel, vel, e, e->state_current.glowcolor, false, true, NULL, NULL);
+               // pass time as count so that trails that are time based (such as an emitter) will emit properly as long as they don't use trailspacing
+               CL_ParticleTrail(trailtype, bound(0, cl.time - cl.oldtime, 0.1), e->persistent.trail_origin, origin, vel, vel, e, e->state_current.glowcolor, false, true, NULL, NULL);
        }
        // now that the entity has survived one trail update it is allowed to
        // leave a real trail on later frames
@@ -2015,7 +2018,7 @@ For program optimization
 static void CL_TimeRefresh_f (void)
 {
        int i;
-       float timestart, timedelta;
+       double timestart, timedelta;
 
        r_refdef.scene.extraupdate = false;
 
@@ -2485,6 +2488,3 @@ void CL_Init (void)
 
        CL_Video_Init();
 }
-
-
-