From: havoc Date: Mon, 9 Feb 2004 07:08:45 +0000 (+0000) Subject: fix a particle trail bug with freshly spawned entities that leave a trail, I don... X-Git-Tag: xonotic-v0.1.0preview~6106 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=11609a2810284bf48e48e25eea6415d42308b7b8;p=xonotic%2Fdarkplaces.git 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 --- 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);