From 5fe4d74b3b79eaad7cd759893166b1bda1f319d3 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Tue, 7 Mar 2006 11:44:40 +0000 Subject: * Fix to a crash when cg_depthSortParticles was set to 0 --- src/cgame/cg_particles.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c index e256f397..b435f56e 100644 --- a/src/cgame/cg_particles.c +++ b/src/cgame/cg_particles.c @@ -2221,6 +2221,9 @@ static void CG_CompactAndSortParticles( void ) for( i = 0; i < MAX_PARTICLES; i++ ) sortedParticles[ i ] = &particles[ i ]; + if( !cg_depthSortParticles.integer ) + return; + for( i = MAX_PARTICLES - 1; i >= 0; i-- ) { if( sortedParticles[ i ]->valid ) @@ -2436,8 +2439,7 @@ void CG_AddParticles( void ) CG_SpawnNewParticles( ); //sorting - if( cg_depthSortParticles.integer ) - CG_CompactAndSortParticles( ); + CG_CompactAndSortParticles( ); for( i = 0; i < MAX_PARTICLES; i++ ) { -- cgit