]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix div0
authorRudolf Polzer <divverent@xonotic.org>
Sat, 27 Jul 2013 09:44:26 +0000 (11:44 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 27 Jul 2013 09:44:26 +0000 (11:44 +0200)
cl_particles.c

index 998f80cc0d7c8c10c62ed2e874eddc6cbf4050d6..e2e9ca08d1235a42b2e45bf07fbd5d544b1b9b3a 100644 (file)
@@ -1496,6 +1496,8 @@ static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, con
                                        continue;
                                if ((info->flags & PARTICLEEFFECT_NOTUNDERWATER) && underwater)
                                        continue;
+
+                               // if trailspacing is set, only ever use this effect as trail
                                if (info->trailspacing > 0 && !istrail)
                                        continue;
 
@@ -1579,7 +1581,8 @@ static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, con
                                        {
                                                float cnt = info->countabsolute;
                                                cnt += (pcount * info->countmultiplier) * cl_particles_quality.value;
-                                               cnt += (traillen / info->trailspacing) * cl_particles_quality.value;
+                                               if (info->trailspacing > 0)
+                                                       cnt += (traillen / info->trailspacing) * cl_particles_quality.value;
                                                cnt *= fade;
                                                info->particleaccumulator += cnt;
                                                trailstep = traillen / cnt;