fix handling of the restart-animation bit
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Dec 2010 20:14:31 +0000 (20:14 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Dec 2010 20:14:31 +0000 (20:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10685 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c

index 8bf930c..890be7e 100644 (file)
@@ -2019,6 +2019,16 @@ void CL_MoveLerpEntityStates(entity_t *ent)
        // trigger muzzleflash effect if necessary
        if (ent->state_current.effects & EF_MUZZLEFLASH)
                ent->persistent.muzzleflash = 1;
+
+       // restart animation bit
+       if ((ent->state_previous.effects & EF_RESTARTANIM_BIT) != (ent->state_current.effects & EF_RESTARTANIM_BIT))
+       {
+               ent->render.framegroupblend[1] = ent->render.framegroupblend[0];
+               ent->render.framegroupblend[1].lerp = 1;
+               ent->render.framegroupblend[0].frame = ent->state_current.frame;
+               ent->render.framegroupblend[0].start = cl.time;
+               ent->render.framegroupblend[0].lerp = 0;
+       }
 }
 
 /*