]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
added prvm_startupreuseedicttime cvar
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Sep 2009 17:15:25 +0000 (17:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Sep 2009 17:15:25 +0000 (17:15 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9241 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c

index ef5622b0a849c39026558be22d5c9532e492ec0c..1eba81412a9c3721aef1fae5fc3d4ed99fbb6d7b 100644 (file)
@@ -39,6 +39,7 @@ 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)"};
 
 qboolean prvm_runawaycheck = true;
 
@@ -247,7 +248,7 @@ qboolean PRVM_ED_CanAlloc(prvm_edict_t *e)
 {
        if(!e->priv.required->free)
                return false;
-       if(e->priv.required->freetime < prog->starttime + 2)
+       if(e->priv.required->freetime < prog->starttime + prvm_startupreuseedicttime.value)
                return true;
        if(realtime > e->priv.required->freetime + 1)
                return true;
@@ -2311,6 +2312,7 @@ void PRVM_Init (void)
        Cvar_RegisterVariable (&prvm_leaktest);
        Cvar_RegisterVariable (&prvm_leaktest_ignore_classnames);
        Cvar_RegisterVariable (&prvm_errordump);
+       Cvar_RegisterVariable (&prvm_startupreuseedicttime);
 
        // COMMANDLINEOPTION: PRVM: -norunaway disables the runaway loop check (it might be impossible to exit DarkPlaces if used!)
        prvm_runawaycheck = !COM_CheckParm("-norunaway");