e = PRVM_EDICT_NUM(i);
// the first couple seconds of server time can involve a lot of
// freeing and allocating, so relax the replacement policy
- if (e->priv.required->free && ( e->priv.required->freetime < 2 || prog->globaloffsets.time < 0 || (PRVM_GLOBALFIELDVALUE(prog->globaloffsets.time)->_float - e->priv.required->freetime) > 0.5 ) )
+ if (e->priv.required->free && ( e->priv.required->freetime < prog->starttime + 2 || (realtime - e->priv.required->freetime) > 1 ) )
{
PRVM_ED_ClearEdict (e);
e->priv.required->allocation_origin = PRVM_AllocationOrigin();
PRVM_GCALL(free_edict)(ed);
ed->priv.required->free = true;
- ed->priv.required->freetime = prog->globaloffsets.time >= 0 ? PRVM_GLOBALFIELDVALUE(prog->globaloffsets.time)->_float : 0;
+ ed->priv.required->freetime = realtime;
if(ed->priv.required->allocation_origin)
{
PRVM_Free((char *)ed->priv.required->allocation_origin);