From: havoc Date: Mon, 17 Jan 2005 23:30:20 +0000 (+0000) Subject: now adapts sv.num_edicts according to how many edicts are found by SV_Physics, so... X-Git-Tag: xonotic-v0.1.0preview~5206 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=babaab25fd28236f83cf2da8a42ca326bc1339a2;p=xonotic%2Fdarkplaces.git now adapts sv.num_edicts according to how many edicts are found by SV_Physics, so if a lot of temporary stuff spawns and removes itself it will knock the num_edicts back down git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4943 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/sv_phys.c b/sv_phys.c index df4990be..1505372e 100644 --- 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