From: divverent Date: Wed, 11 Feb 2009 14:27:23 +0000 (+0000) Subject: fix memory corruption when using trailparticles with an effect that has a dlight X-Git-Tag: xonotic-v0.1.0preview~1893 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9deeeb6b94762dbf7e9156b098bb164f91aa0184;p=xonotic%2Fdarkplaces.git fix memory corruption when using trailparticles with an effect that has a dlight git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8701 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_particles.c b/cl_particles.c index e2d388ac..b3730622 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -1217,7 +1217,8 @@ void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins // glowing entity // called by CL_LinkNetworkEntity Matrix4x4_Scale(&tempmatrix, info->lightradiusstart, 1); - R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &tempmatrix, info->lightcolor, -1, info->lightcubemapnum > 0 ? va("cubemaps/%i", info->lightcubemapnum) : NULL, info->lightshadow, 1, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE); + if(r_refdef.scene.numlights < MAX_DLIGHTS) + R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &tempmatrix, info->lightcolor, -1, info->lightcubemapnum > 0 ? va("cubemaps/%i", info->lightcubemapnum) : NULL, info->lightshadow, 1, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE); } }