--- tremulous/src/cgame/cg_trails.c +++ tremulous/src/cgame/cg_trails.c @@ -60,7 +60,7 @@ if( ts->destroyTime > 0 && btb->fadeOutTime ) { - fadeAlpha -= ( cg.time - ts->destroyTime ) / btb->fadeOutTime; + fadeAlpha -= (float)( cg.time - ts->destroyTime ) / btb->fadeOutTime; if( fadeAlpha < 0.0f ) fadeAlpha = 0.0f; @@ -558,24 +558,20 @@ deltaTime = cg.time - tb->lastEvalTime; tb->lastEvalTime = cg.time; - // first make sure this beam has enough nodes - if( ts->destroyTime <= 0 ) - { - nodesToAdd = btb->numSegments - CG_CountBeamNodes( tb ) + 1; - - while( nodesToAdd-- ) - { - i = CG_AppendBeamNode( tb ); - - if( !tb->nodes->next && CG_Attached( &ts->frontAttachment ) ) - { - // this is the first node to be added - if( !CG_AttachmentPoint( &ts->frontAttachment, i->refPosition ) ) - CG_DestroyTrailSystem( &ts ); - } - else - VectorCopy( i->prev->refPosition, i->refPosition ); - } + nodesToAdd = btb->numSegments - CG_CountBeamNodes( tb ) + 1; + + while( nodesToAdd-- ) + { + i = CG_AppendBeamNode( tb ); + + if( !tb->nodes->next && CG_Attached( &ts->frontAttachment ) ) + { + // this is the first node to be added + if( !CG_AttachmentPoint( &ts->frontAttachment, i->refPosition ) ) + CG_DestroyTrailSystem( &ts ); + } + else + VectorCopy( i->prev->refPosition, i->refPosition ); } numNodes = CG_CountBeamNodes( tb ); @@ -630,9 +626,7 @@ return; } - // if the ts has been destroyed, stop creating new nodes - if( ts->destroyTime <= 0 ) - CG_PrependBeamNode( tb ); + CG_PrependBeamNode( tb ); } else if( i->timeLeft >= 0 && i->prev ) {