Skip to content

Commit

Permalink
Fix FX_SpriteTrail sprite frames
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed Oct 19, 2023
1 parent ec112bb commit dff436d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cl_dll/cl_msg_fx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ void FX_Sprite_Trail( Vector start, Vector end, int modelIndex, int count, float
TEMPENTITY *pTemp = gEngfuncs.pEfxAPI->CL_TempEntAlloc( pos, pmodel );
if( !pTemp ) return;

pTemp->flags = (FTENT_COLLIDEWORLD|FTENT_SPRCYCLE|FTENT_FADEOUT|FTENT_SLOWGRAVITY);
pTemp->flags = (FTENT_COLLIDEWORLD|FTENT_FADEOUT|FTENT_SLOWGRAVITY);
pTemp->frameMax = pmodel->numframes;
if (pmodel->numframes > 1)
pTemp->flags |= FTENT_SPRCYCLE;

VectorScale( dir, speed, vel );
vel[0] += Com_RandomFloat( -127.0f, 128.0f ) * amp;
Expand All @@ -301,7 +304,8 @@ void FX_Sprite_Trail( Vector start, Vector end, int modelIndex, int count, float
pTemp->entity.curstate.rendercolor.g = g;
pTemp->entity.curstate.rendercolor.b = b;

pTemp->entity.curstate.frame = Com_RandomLong( 0, pTemp->frameMax );
if (pmodel->numframes > 1)
pTemp->entity.curstate.frame = Com_RandomLong( 0, pmodel->numframes-1 );
pTemp->die = clientTime + life;
if (extraLifeMax)
pTemp->die += Com_RandomFloat( 0.0f, extraLifeMax );
Expand Down

0 comments on commit dff436d

Please sign in to comment.