From: havoc Date: Sat, 26 Sep 2009 17:21:19 +0000 (+0000) Subject: renamed prvm_startupreuseedicttime to prvm_reuseedicts_startuptime X-Git-Tag: xonotic-v0.1.0preview~1391 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c1badb6b99e85cc6fe4abbc4390bc6989c606c2b;p=xonotic%2Fdarkplaces.git renamed prvm_startupreuseedicttime to prvm_reuseedicts_startuptime added cvar prvm_reuseedicts_neverinsameframe git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9242 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/prvm_edict.c b/prvm_edict.c index 1eba8141..da9dec06 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -39,7 +39,8 @@ cvar_t prvm_backtraceforwarnings = {0, "prvm_backtraceforwarnings", "0", "print cvar_t prvm_leaktest = {0, "prvm_leaktest", "0", "try to detect memory leaks in strings or entities"}; cvar_t prvm_leaktest_ignore_classnames = {0, "prvm_leaktest_ignore_classnames", "", "classnames of entities to NOT leak check because they are found by find(world, classname, ...) but are actually spawned by QC code (NOT map entities)"}; cvar_t prvm_errordump = {0, "prvm_errordump", "0", "write a savegame on crash to crash-server.dmp"}; -cvar_t prvm_startupreuseedicttime = {0, "prvm_startupreuseedicttime", "2", "allows immediate re-use of freed entity slots during start of new level (value in seconds)"}; +cvar_t prvm_reuseedicts_startuptime = {0, "prvm_reuseedicts_startuptime", "2", "allows immediate re-use of freed entity slots during start of new level (value in seconds)"}; +cvar_t prvm_reuseedicts_neverinsameframe = {0, "prvm_reuseedicts_neverinsameframe", "1", "never allows re-use of freed entity slots during same frame"}; qboolean prvm_runawaycheck = true; @@ -248,7 +249,9 @@ qboolean PRVM_ED_CanAlloc(prvm_edict_t *e) { if(!e->priv.required->free) return false; - if(e->priv.required->freetime < prog->starttime + prvm_startupreuseedicttime.value) + if(realtime <= e->priv.required->freetime && prvm_reuseedicts_neverinsameframe.integer) + return false; // never allow reuse in same frame (causes networking trouble) + if(e->priv.required->freetime < prog->starttime + prvm_reuseedicts_startuptime.value) return true; if(realtime > e->priv.required->freetime + 1) return true; @@ -2312,7 +2315,8 @@ void PRVM_Init (void) Cvar_RegisterVariable (&prvm_leaktest); Cvar_RegisterVariable (&prvm_leaktest_ignore_classnames); Cvar_RegisterVariable (&prvm_errordump); - Cvar_RegisterVariable (&prvm_startupreuseedicttime); + Cvar_RegisterVariable (&prvm_reuseedicts_startuptime); + Cvar_RegisterVariable (&prvm_reuseedicts_neverinsameframe); // COMMANDLINEOPTION: PRVM: -norunaway disables the runaway loop check (it might be impossible to exit DarkPlaces if used!) prvm_runawaycheck = !COM_CheckParm("-norunaway");