]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
When reallocating CSQC render entity space, make sure existing render edicts referenc...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 16 Dec 2010 06:39:02 +0000 (06:39 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 16 Dec 2010 18:40:14 +0000 (19:40 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10664 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=584aaf7e7cc8616fb4fb40d73102c78cb6805fa4

cl_main.c

index 26bac7799dc0fdeae9b421ccc8b1bf0e4ae0cc36..0d340a80875103a0cf53d0dbd07015629240c0cb 100644 (file)
--- 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);
                }
        }