From b7d97498e4d755b19b4f204471596a413046834c Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 3 May 2007 07:40:58 +0000 Subject: [PATCH] fix bug where attached models spawn a trail from their non-attached start location to their new location on the first frame git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7226 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 5 ++++- cl_parse.c | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cl_main.c b/cl_main.c index 84d93e84..e15cb454 100644 --- a/cl_main.c +++ b/cl_main.c @@ -1094,7 +1094,10 @@ void CL_UpdateNetworkEntityTrail(entity_t *e) // do trails if (e->render.flags & RENDER_GLOWTRAIL) trailtype = EFFECT_TR_GLOWTRAIL; - if (trailtype) + // be sure to check for changes in e->state_previous.active and + // modelindex so that entities which did not exist in the previous + // frame don't create a trail from the start location + if (trailtype && e->state_previous.active && e->state_previous.modelindex == e->state_current.modelindex) { float len; vec3_t vel; diff --git a/cl_parse.c b/cl_parse.c index 75f1e2b9..79c0469f 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1624,7 +1624,6 @@ void CL_MoveLerpEntityStates(entity_t *ent) ent->render.framelerp = 1; // reset various persistent stuff ent->persistent.muzzleflash = 0; - VectorCopy(ent->state_current.origin, ent->persistent.trail_origin); } else if (DotProduct(odelta, odelta) > 1000*1000 || (cl.fixangle[0] && !cl.fixangle[1])) { -- 2.39.2