From bd53a40cee4bd5fbcbaef6c7f9d9f8f2c8c4a687 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 27 Jul 2013 11:44:26 +0200 Subject: [PATCH] fix div0 --- cl_particles.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.39.2