From 9deeeb6b94762dbf7e9156b098bb164f91aa0184 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 11 Feb 2009 14:27:23 +0000 Subject: [PATCH] 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 --- cl_particles.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } } -- 2.39.2