From 11609a2810284bf48e48e25eea6415d42308b7b8 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 9 Feb 2004 07:08:45 +0000 Subject: [PATCH] fix a particle trail bug with freshly spawned entities that leave a trail, I don't really understand how this bug happens (or why it doesn't happen all the time), but it is fixed git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3882 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_particles.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cl_particles.c b/cl_particles.c index 44766546..b9d73f76 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -1105,7 +1105,9 @@ void CL_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent) // if we skip out, leave it reset ent->persistent.trail_time = 0.0f; - speed = 1.0f / (ent->state_current.time - ent->state_previous.time); + speed = ent->state_current.time - ent->state_previous.time; + if (speed) + speed = 1.0f / speed; VectorSubtract(ent->state_current.origin, ent->state_previous.origin, vel); #endif VectorScale(vel, speed, vel); -- 2.39.2