From: havoc Date: Mon, 10 Feb 2003 21:02:29 +0000 (+0000) Subject: almost lost this very important part of the MAX_EDICTS commit X-Git-Tag: xonotic-v0.1.0preview~6776 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=1cf9b7ac5efb61184a2053238ae0c2358394a5c0 almost lost this very important part of the MAX_EDICTS commit git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2729 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/sv_main.c b/sv_main.c index 3e0f6866..8a4dc51c 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1772,10 +1772,15 @@ void SV_SpawnServer (const char *server) // clear the edict memory pool Mem_EmptyPool(sv_edicts_mempool); + // edict_t structures (hidden from progs) sv.edicts = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * sizeof(edict_t)); + // progs fields, often accessed by server sv.edictsfields = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * pr_edict_size); + // table of edict pointers, for quicker lookup of edicts sv.edictstable = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * sizeof(edict_t *)); - for (i = 0;i < MAX_EDICTS;i++) + // used by PushMove to move back pushed entities + sv.moved_edicts = Mem_Alloc(sv_edicts_mempool, sv.max_edicts * sizeof(edict_t *)); + for (i = 0;i < sv.max_edicts;i++) { ent = sv.edicts + i; ent->v = (void *)((qbyte *)sv.edictsfields + i * pr_edict_size);