]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
allow time-based traileffectnum effects by passing frametime as count to
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Nov 2011 20:27:31 +0000 (20:27 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 8 Nov 2011 20:57:04 +0000 (21:57 +0100)
the particle effect, this means that a trail effect can use count rather
than trailspacing for a time-based effect

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11539 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=bff24a1ec93aad0f413d2d22171aa95e105fbdb6

cl_main.c

index 96cca42147aa91a1e7b734c2b2cca9d355566c91..1d8c3f3ea2a822e55195e290460ca5e75bf5e4ed 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -1275,7 +1275,8 @@ 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