summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-03-07 11:44:40 +0000
committerTim Angus <tim@ngus.net>2006-03-07 11:44:40 +0000
commit5fe4d74b3b79eaad7cd759893166b1bda1f319d3 (patch)
tree9514ebda670b175e0ef2459c9f188d53855e187a /src
parentc11a4f5916b67653402cb78e3fcbc5e2f5ff3bb1 (diff)
* Fix to a crash when cg_depthSortParticles was set to 0
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_particles.c6
1 files 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++ )
{