From 584aaf7e7cc8616fb4fb40d73102c78cb6805fa4 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 16 Dec 2010 06:39:02 +0000 Subject: [PATCH] When reallocating CSQC render entity space, make sure existing render edicts referencing them are adjusted git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10664 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cl_main.c b/cl_main.c index 26bac779..0d340a80 100644 --- a/cl_main.c +++ b/cl_main.c @@ -297,6 +297,7 @@ void CL_ExpandEntities(int num) void CL_ExpandCSQCRenderEntities(int num) { + int i; int oldmaxcsqcrenderentities; entity_render_t *oldcsqcrenderentities; if (num >= cl.max_csqcrenderentities) @@ -310,6 +311,9 @@ void CL_ExpandCSQCRenderEntities(int num) if (oldcsqcrenderentities) { memcpy(cl.csqcrenderentities, oldcsqcrenderentities, oldmaxcsqcrenderentities * sizeof(entity_render_t)); + for (i = 0;i < r_refdef.scene.numentities;i++) + if(r_refdef.scene.entities[i] >= oldcsqcrenderentities && r_refdef.scene.entities[i] < (oldcsqcrenderentities + oldmaxcsqcrenderentities)) + r_refdef.scene.entities[i] = cl.csqcrenderentities + (r_refdef.scene.entities[i] - oldcsqcrenderentities); Mem_Free(oldcsqcrenderentities); } } -- 2.39.2