From: Rudolf Polzer Date: Sat, 27 Jul 2013 09:44:26 +0000 (+0200) Subject: fix div0 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bd53a40cee4bd5fbcbaef6c7f9d9f8f2c8c4a687;p=xonotic%2Fdarkplaces.git fix div0 --- diff --git a/cl_particles.c b/cl_particles.c index 998f80cc..e2e9ca08 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -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;