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;
{
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;
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");