From: divverent Date: Tue, 10 Mar 2015 10:45:32 +0000 (+0000) Subject: Limit number of particles created at once. X-Git-Tag: xonotic-v0.8.5~88^2~115 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1473091061d4abb39bfcc6c1713d747be0454748;p=xonotic%2Fdarkplaces.git Limit number of particles created at once. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12206 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_particles.c b/cl_particles.c index fb81172c..54f73efb 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -1248,7 +1248,7 @@ static void CL_ParticleEffect_Fallback(int effectnameindex, float count, const v { vec3_t dir, pos; float len, dec, qd; - int smoke, blood, bubbles, r, color; + int smoke, blood, bubbles, r, color, count; if (spawndlight && r_refdef.scene.numlights < MAX_DLIGHTS) { @@ -1284,6 +1284,7 @@ static void CL_ParticleEffect_Fallback(int effectnameindex, float count, const v VectorSubtract(originmaxs, originmins, dir); len = VectorNormalizeLength(dir); + if (ent) { dec = -ent->persistent.trail_time; @@ -1305,8 +1306,9 @@ static void CL_ParticleEffect_Fallback(int effectnameindex, float count, const v blood = cl_particles.integer && cl_particles_blood.integer; bubbles = cl_particles.integer && cl_particles_bubbles.integer && !cl_particles_quake.integer && (CL_PointSuperContents(pos) & (SUPERCONTENTS_WATER | SUPERCONTENTS_SLIME)); qd = 1.0f / cl_particles_quality.value; + count = 0; - while (len >= 0) + while (len >= 0 && ++count <= 16384) { dec = 3; if (blood)