]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix bug where attached models spawn a trail from their non-attached
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 3 May 2007 07:40:58 +0000 (07:40 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 3 May 2007 07:40:58 +0000 (07:40 +0000)
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
cl_parse.c

index 84d93e84206b4827304cf10e5c8bb94ebe4ac647..e15cb454dec44144d56d7073c4f81d439984bc22 100644 (file)
--- 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;
index 75f1e2b9654daa2d8f62f0aac48bbc3d988a2c72..79c0469f2cd28f03d2fad8f45ba97a7b72c00346 100644 (file)
@@ -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]))
        {