{
// engine-private fields (stored in dynamically resized array)
//edict_engineprivate_t *e;
- prvm_edict_private_t *e;
+ union
+ {
+ prvm_edict_private_t *e;
+ void *vp;
+ //add other types as you desire
+ } p;
// QuakeC fields (stored in dynamically resized array)
//entvars_t *v;
void *v;
{
prog->xfunction->builtinsprofile++;
ed = PRVM_EDICT_NUM(e);
- if (ed->e->free)
+ if (ed->p.e->free)
continue;
t = PRVM_E_STRING(ed,f);
if (!t)
{
prog->xfunction->builtinsprofile++;
ed = PRVM_EDICT_NUM(e);
- if (ed->e->free)
+ if (ed->p.e->free)
continue;
if (PRVM_E_FLOAT(ed,f) == s)
{
for (i = 1;i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
{
prog->xfunction->builtinsprofile++;
- if (ent->e->free)
+ if (ent->p.e->free)
continue;
t = PRVM_E_STRING(ent,f);
if (!t)
for (i = 1;i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
{
prog->xfunction->builtinsprofile++;
- if (ent->e->free)
+ if (ent->p.e->free)
continue;
if (E_FLOAT(ent,f) != s)
continue;
return;
}
ent = PRVM_EDICT_NUM(i);
- if (!ent->e->free)
+ if (!ent->p.e->free)
{
VM_RETURN_EDICT(ent);
return;
}
ent = PRVM_G_EDICT(OFS_PARM1);
- if(ent->e->free)
+ if(ent->p.e->free)
{
Con_Printf("VM_M_writetofile: %s: entity %i is free !\n", PRVM_NAME, PRVM_EDICT_NUM(OFS_PARM1));
return;
// set edict pointers
for(i = 0; i < prog->max_edicts; i++)
{
- prog->edicts[i].e = (prvm_edict_private_t *)((qbyte *)prog->edictprivate + i * prog->edictprivate_size);
+ prog->edicts[i].p.e = (prvm_edict_private_t *)((qbyte *)prog->edictprivate + i * prog->edictprivate_size);
prog->edicts[i].v = (void*)((qbyte *)prog->edictsfields + i * prog->edict_size);
}
}
//set e and v pointers
for(i = 0; i < prog->max_edicts; i++)
{
- prog->edicts[i].e = (prvm_edict_private_t *)((qbyte *)prog->edictprivate + i * prog->edictprivate_size);
+ prog->edicts[i].p.e = (prvm_edict_private_t *)((qbyte *)prog->edictprivate + i * prog->edictprivate_size);
prog->edicts[i].v = (void*)((qbyte *)prog->edictsfields + i * prog->edict_size);
}
{
int num;
memset (e->v, 0, prog->progs->entityfields * 4);
- e->e->free = false;
+ e->p.e->free = false;
// LordHavoc: for consistency set these here
num = PRVM_NUM_FOR_EDICT(e) - 1;
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->e->free && ( e->e->freetime < 2 || (*prog->time - e->e->freetime) > 0.5 ) )
+ if (e->p.e->free && ( e->p.e->freetime < 2 || (*prog->time - e->p.e->freetime) > 0.5 ) )
{
PRVM_ED_ClearEdict (e);
return e;
PRVM_GCALL(free_edict)(ed);
- ed->e->free = true;
- ed->e->freetime = *prog->time;
+ ed->p.e->free = true;
+ ed->p.e->freetime = *prog->time;
}
//===========================================================================
int type;
char tempstring[8192], tempstring2[260]; // temporary string buffers
- if (ed->e->free)
+ if (ed->p.e->free)
{
Con_Printf("%s: FREE\n",PRVM_NAME);
return;
FS_Print(f, "{\n");
- if (ed->e->free)
+ if (ed->p.e->free)
{
FS_Print(f, "}\n");
return;
for (i=0 ; i<prog->num_edicts ; i++)
{
ent = PRVM_EDICT_NUM(i);
- if (ent->e->free)
+ if (ent->p.e->free)
continue;
active++;
}
}
if (!init)
- ent->e->free = true;
+ ent->p.e->free = true;
return data;
}
}
spawned++;
- if (ent->e->free)
+ if (ent->p.e->free)
died++;
}
for (ednum = 0;ednum < prog->max_edicts;ednum++)
{
ed = PRVM_EDICT_NUM(ednum);
- if (ed->e->free)
+ if (ed->p.e->free)
continue;
for (i = 1;i < prog->progs->numfielddefs;i++)
{