]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
now adapts sv.num_edicts according to how many edicts are found by SV_Physics, so...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 17 Jan 2005 23:30:20 +0000 (23:30 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 17 Jan 2005 23:30:20 +0000 (23:30 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4943 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index df4990be4214146c73f9b7e0ae70dfdc74e5ba41..1505372e0ba6d8e31f8b20681f3022b8728c1212 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -1379,7 +1379,7 @@ SV_Physics
 */
 void SV_Physics (void)
 {
-       int i;
+       int i, newnum_edicts;
        edict_t *ent;
        qbyte runmove[MAX_EDICTS];
 
@@ -1389,8 +1389,11 @@ void SV_Physics (void)
        pr_global_struct->time = sv.time;
        PR_ExecuteProgram (pr_global_struct->StartFrame, "QC function StartFrame is missing");
 
+       newnum_edicts = 0;
        for (i = 0, ent = sv.edicts;i < sv.num_edicts;i++, ent = NEXT_EDICT(ent))
-               runmove[i] = !ent->e->free;
+               if ((runmove[i] = !ent->e->free))
+                       newnum_edicts = i + 1;
+       sv.num_edicts = max(svs.maxclients + 1, newnum_edicts);
 
 //
 // treat each object in turn