]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
make sure particles are reset on level change by clearing the array
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Aug 2004 09:09:57 +0000 (09:09 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Aug 2004 09:09:57 +0000 (09:09 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4400 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c

index 2e0d968488fc3cf03faf8a9b017e0243ce00abf7..477ba5f56b8672a42f72ca2171512be6b0e7fa4b 100644 (file)
@@ -311,6 +311,7 @@ void CL_Particles_Clear(void)
 {
        cl_numparticles = 0;
        cl_freeparticle = 0;
+       memset(particles, 0, sizeof(particle_t) * cl_maxparticles);
 }
 
 /*
@@ -359,8 +360,7 @@ void CL_Particles_Init (void)
        cl_part_mempool = Mem_AllocPool("CL_Part", 0, NULL);
        particles = (particle_t *) Mem_Alloc(cl_part_mempool, cl_maxparticles * sizeof(particle_t));
 #endif
-       cl_numparticles = 0;
-       cl_freeparticle = 0;
+       CL_Particles_Clear();
 }
 
 // list of all 26 parameters: