From: divverent Date: Thu, 16 Dec 2010 06:39:02 +0000 (+0000) Subject: When reallocating CSQC render entity space, make sure existing render edicts referenc... X-Git-Tag: xonotic-v0.1.0preview~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=258971d5cc1888f7fb9d911f13516ff1360803c3;p=xonotic%2Fdarkplaces.git 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 ::stable-branch::merge=584aaf7e7cc8616fb4fb40d73102c78cb6805fa4 --- 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); } }