if (tagentity == NULL)
tagentity = prog->edicts;
- v = PRVM_GETEDICTFIELDVALUE(e, prog->fieldoffsets.tag_entity);
+ v = PRVM_EDICTFIELDVALUE(e, prog->fieldoffsets.tag_entity);
if (v)
v->edict = PRVM_EDICT_TO_PROG(tagentity);
- v = PRVM_GETEDICTFIELDVALUE(e, prog->fieldoffsets.tag_index);
+ v = PRVM_EDICTFIELDVALUE(e, prog->fieldoffsets.tag_index);
if (v)
v->_float = 0;
if (tagentity != NULL && tagentity != prog->edicts && tagname && tagname[0])
else
tagmatrix = identitymatrix;
- if ((val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.tag_entity)) && val->edict)
+ if ((val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.tag_entity)) && val->edict)
{ // DP_GFX_QUAKE3MODELTAGS, scan all chain and stop on unattached entity
attachloop = 0;
do
{
attachent = PRVM_EDICT_NUM(val->edict); // to this it entity our entity is attached
- val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.tag_index);
+ val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.tag_index);
model = CSQC_GetModelFromEntity(attachent);
attachmatrix = identitymatrix;
// apply transformation by child entity matrix
- val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.scale);
+ val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.scale);
if (val->_float == 0)
val->_float = 1;
Matrix4x4_CreateFromQuakeEntity(&entitymatrix, ent->fields.client->origin[0], ent->fields.client->origin[1], ent->fields.client->origin[2], -ent->fields.client->angles[0], ent->fields.client->angles[1], ent->fields.client->angles[2], val->_float);
if (attachloop > 255) // prevent runaway looping
return 5;
}
- while ((val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.tag_entity)) && val->edict);
+ while ((val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.tag_entity)) && val->edict);
}
// normal or RENDER_VIEWMODEL entity (or main parent entity on attach chain)
- val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.scale);
+ val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.scale);
if (val->_float == 0)
val->_float = 1;
// Alias models have inverse pitch, bmodels can't have tags, so don't check for modeltype...
Matrix4x4_CreateFromQuakeEntity(&entitymatrix, ent->fields.client->origin[0], ent->fields.client->origin[1], ent->fields.client->origin[2], -ent->fields.client->angles[0], ent->fields.client->angles[1], ent->fields.client->angles[2], val->_float);
Matrix4x4_Concat(out, &entitymatrix, &tagmatrix);
- if ((val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.renderflags)) && (RF_VIEWMODEL & (int)val->_float))
+ if ((val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.renderflags)) && (RF_VIEWMODEL & (int)val->_float))
{// RENDER_VIEWMODEL magic
Matrix4x4_Copy(&tagmatrix, out);
- val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.scale);
+ val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.scale);
if (val->_float == 0)
val->_float = 1;
continue;
if (maxs1[0] < mins2[0] || maxs1[1] < mins2[1] || maxs1[2] < mins2[2])
continue;
- PRVM_GETEDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_NUM_FOR_EDICT(chain);
+ PRVM_EDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_NUM_FOR_EDICT(chain);
chain = ent;
}
continue;
if (maxs1[0] < mins2[0] || maxs1[1] < mins2[1] || maxs1[2] < mins2[2])
continue;
- PRVM_GETEDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_NUM_FOR_EDICT(chain);
+ PRVM_EDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_NUM_FOR_EDICT(chain);
chain = ent;
}
// FIXME: renderflags should be in the cl_entvars_t
#if 1
renderflags = 0;
- if((val = PRVM_GETEDICTFIELDVALUE(ed, prog->fieldoffsets.renderflags)) && val->_float) renderflags = (int)val->_float;
+ if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.renderflags)) && val->_float) renderflags = (int)val->_float;
#else
renderflags = (int)ed->fields.client->renderflags;
#endif
- if((val = PRVM_GETEDICTFIELDVALUE(ed, prog->fieldoffsets.alpha)) && val->_float) e->render.alpha = val->_float;
- if((val = PRVM_GETEDICTFIELDVALUE(ed, prog->fieldoffsets.scale)) && val->_float) e->render.scale = scale = val->_float;
- if((val = PRVM_GETEDICTFIELDVALUE(ed, prog->fieldoffsets.colormod)) && VectorLength2(val->vector)) VectorCopy(val->vector, e->render.colormod);
- if((val = PRVM_GETEDICTFIELDVALUE(ed, prog->fieldoffsets.effects)) && val->_float) e->render.effects = (int)val->_float;
- if((val = PRVM_GETEDICTFIELDVALUE(ed, prog->fieldoffsets.tag_entity)) && val->edict)
+ if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.alpha)) && val->_float) e->render.alpha = val->_float;
+ if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.scale)) && val->_float) e->render.scale = scale = val->_float;
+ if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.colormod)) && VectorLength2(val->vector)) VectorCopy(val->vector, e->render.colormod);
+ if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.effects)) && val->_float) e->render.effects = (int)val->_float;
+ if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.tag_entity)) && val->edict)
{
int tagentity;
int tagindex = 0;
tagentity = val->edict;
- if((val = PRVM_GETEDICTFIELDVALUE(ed, prog->fieldoffsets.tag_index)) && val->_float)
+ if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.tag_index)) && val->_float)
tagindex = (int)val->_float;
// FIXME: calculate tag matrix
Matrix4x4_CreateIdentity(&tagmatrix);
CL_UpdateRenderEntity(&e->render);
i = 0;
- if((val = PRVM_GETEDICTFIELDVALUE(ed, prog->fieldoffsets.renderflags)) && val->_float)
+ if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.renderflags)) && val->_float)
{
i = (int)val->_float;
if(i & RF_VIEWMODEL) e->render.flags |= RENDER_VIEWMODEL;
// point the string back at updateclient->name to keep it safe
strlcpy (host_client->playermodel, newPath, sizeof (host_client->playermodel));
if( prog->fieldoffsets.playermodel >= 0 )
- PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playermodel)->string = PRVM_SetEngineString(host_client->playermodel);
+ PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playermodel)->string = PRVM_SetEngineString(host_client->playermodel);
if (strcmp(host_client->old_model, host_client->playermodel))
{
strlcpy(host_client->old_model, host_client->playermodel, sizeof(host_client->old_model));
// point the string back at updateclient->name to keep it safe
strlcpy (host_client->playerskin, newPath, sizeof (host_client->playerskin));
if( prog->fieldoffsets.playerskin >= 0 )
- PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playerskin)->string = PRVM_SetEngineString(host_client->playerskin);
+ PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playerskin)->string = PRVM_SetEngineString(host_client->playerskin);
if (strcmp(host_client->old_skin, host_client->playerskin))
{
//if (host_client->spawned)
prvm_eval_t *val;
if (host_client->edict)
{
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.clientcolors)))
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.clientcolors)))
val->_float = playercolor;
host_client->edict->fields.server->team = bottom + 1;
}
return;
}
- if (host_client->edict && (val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.pmodel)))
+ if (host_client->edict && (val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.pmodel)))
val->_float = i;
}
break;
case 's':
- if (gamemode == GAME_ROGUE && (val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_shells1)))
+ if (gamemode == GAME_ROGUE && (val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_shells1)))
val->_float = v;
host_client->edict->fields.server->ammo_shells = v;
case 'n':
if (gamemode == GAME_ROGUE)
{
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_nails1)))
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_nails1)))
{
val->_float = v;
if (host_client->edict->fields.server->weapon <= IT_LIGHTNING)
case 'l':
if (gamemode == GAME_ROGUE)
{
- val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_lava_nails);
+ val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_lava_nails);
if (val)
{
val->_float = v;
case 'r':
if (gamemode == GAME_ROGUE)
{
- val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_rockets1);
+ val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_rockets1);
if (val)
{
val->_float = v;
case 'm':
if (gamemode == GAME_ROGUE)
{
- val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_multi_rockets);
+ val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_multi_rockets);
if (val)
{
val->_float = v;
case 'c':
if (gamemode == GAME_ROGUE)
{
- val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_cells1);
+ val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_cells1);
if (val)
{
val->_float = v;
case 'p':
if (gamemode == GAME_ROGUE)
{
- val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_plasma);
+ val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ammo_plasma);
if (val)
{
val->_float = v;
}
prvm_edict_t;
-#define PRVM_GETEDICTFIELDVALUE(ed, fieldoffset) (fieldoffset ? (prvm_eval_t *)((unsigned char *)ed->v + fieldoffset) : NULL)
+#define PRVM_EDICTFIELDVALUE(ed, fieldoffset) (fieldoffset ? (prvm_eval_t *)((unsigned char *)ed->v + fieldoffset) : NULL)
//============================================================================
} fields;
} prvm_edict_t;
-#define PRVM_GETEDICTFIELDVALUE(ed, fieldoffset) (fieldoffset >= 0 ? (prvm_eval_t *)((unsigned char *)ed->fields.vp + fieldoffset) : NULL)
-#define PRVM_GETGLOBALFIELDVALUE(fieldoffset) (fieldoffset >= 0 ? (prvm_eval_t *)((unsigned char *)prog->globals.generic + fieldoffset) : NULL)
+#define PRVM_EDICTFIELDVALUE(ed, fieldoffset) (fieldoffset >= 0 ? (prvm_eval_t *)((unsigned char *)ed->fields.vp + fieldoffset) : NULL)
+#define PRVM_GLOBALFIELDVALUE(fieldoffset) (fieldoffset >= 0 ? (prvm_eval_t *)((unsigned char *)prog->globals.generic + fieldoffset) : NULL)
//============================================================================
#define PRVM_OP_STATE 1
// if(!s->active)
// continue;
- val = PRVM_GETEDICTFIELDVALUE((&prog->edicts[s->number]), prog->fieldoffsets.SendEntity);
+ val = PRVM_EDICTFIELDVALUE((&prog->edicts[s->number]), prog->fieldoffsets.SendEntity);
if(val->function)
{
- val2 = PRVM_GETEDICTFIELDVALUE((&prog->edicts[s->number]), prog->fieldoffsets.Version);
+ val2 = PRVM_EDICTFIELDVALUE((&prog->edicts[s->number]), prog->fieldoffsets.Version);
if(sv2csqcents_version[csqc_clent][s->number] == (unsigned char)val2->_float)
continue;
if(!csqcents)
for (i = 0, s = states;i < numstates;i++, s++)
{
- val = PRVM_GETEDICTFIELDVALUE((&prog->edicts[s->number]), prog->fieldoffsets.SendEntity);
+ val = PRVM_EDICTFIELDVALUE((&prog->edicts[s->number]), prog->fieldoffsets.SendEntity);
if(val && val->function)
continue;
ent = states + i;
number = ent->number;
- val = PRVM_GETEDICTFIELDVALUE((&prog->edicts[number]), prog->fieldoffsets.SendEntity);
+ val = PRVM_EDICTFIELDVALUE((&prog->edicts[number]), prog->fieldoffsets.SendEntity);
if(val && val->function)
continue;
for (;onum < o->numentities && o->entitydata[onum].number < number;onum++)
d->currententitynumber = 1;
for (i = 0, n = startnumber;n < prog->max_edicts;n++)
{
- val = PRVM_GETEDICTFIELDVALUE((&prog->edicts[n]), prog->fieldoffsets.SendEntity);
+ val = PRVM_EDICTFIELDVALUE((&prog->edicts[n]), prog->fieldoffsets.SendEntity);
if(val && val->function)
continue;
// find the old state to delta from
unsigned int bits = 0;
prvm_eval_t *val;
- val = PRVM_GETEDICTFIELDVALUE((&prog->edicts[s->number]), prog->fieldoffsets.SendEntity);
+ val = PRVM_EDICTFIELDVALUE((&prog->edicts[s->number]), prog->fieldoffsets.SendEntity);
if(val && val->function)
return;
Con_Printf("======%s ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
if (prog->globaloffsets.self >= 0)
{
- ed = PRVM_PROG_TO_EDICT(PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
+ ed = PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
PRVM_ED_Print(ed);
}
Con_Printf("======OBJECT ERROR======\n"); // , PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string); // or include them? FIXME
if (prog->globaloffsets.self >= 0)
{
- ed = PRVM_PROG_TO_EDICT(PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
+ ed = PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
PRVM_ED_Print(ed);
PRVM_ED_Free (ed);
if (strcmp(t,s))
continue;
- PRVM_GETEDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_NUM_FOR_EDICT(chain);
+ PRVM_EDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_NUM_FOR_EDICT(chain);
chain = ent;
}
if (PRVM_E_FLOAT(ent,f) != s)
continue;
- PRVM_GETEDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_EDICT_TO_PROG(chain);
+ PRVM_EDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_EDICT_TO_PROG(chain);
chain = ent;
}
if (!((int)PRVM_E_FLOAT(ent,f) & s))
continue;
- PRVM_GETEDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_EDICT_TO_PROG(chain);
+ PRVM_EDICTFIELDVALUE(ent,prog->fieldoffsets.chain)->edict = PRVM_EDICT_TO_PROG(chain);
chain = ent;
}
prvm_edict_t *ent;
float ideal, current, move, speed;
- ent = PRVM_PROG_TO_EDICT(PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
+ ent = PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
if (ent == prog->edicts)
{
VM_Warning("changeyaw: can not modify world entity\n");
VM_Warning("changeyaw: angles, ideal_yaw, or yaw_speed field(s) not found\n");
return;
}
- current = ANGLEMOD(PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.angles)->vector[1]);
- ideal = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.ideal_yaw)->_float;
- speed = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.yaw_speed)->_float;
+ current = ANGLEMOD(PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.angles)->vector[1]);
+ ideal = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.ideal_yaw)->_float;
+ speed = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.yaw_speed)->_float;
if (current == ideal)
return;
move = -speed;
}
- PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.angles)->vector[1] = ANGLEMOD (current + move);
+ PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.angles)->vector[1] = ANGLEMOD (current + move);
}
/*
VM_Warning("changepitch: angles, idealpitch, or pitch_speed field(s) not found\n");
return;
}
- current = ANGLEMOD(PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.angles)->vector[0]);
- ideal = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.idealpitch)->_float;
- speed = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.pitch_speed)->_float;
+ current = ANGLEMOD(PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.angles)->vector[0]);
+ ideal = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.idealpitch)->_float;
+ speed = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.pitch_speed)->_float;
if (current == ideal)
return;
move = -speed;
}
- PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.angles)->vector[0] = ANGLEMOD (current + move);
+ PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.angles)->vector[0] = ANGLEMOD (current + move);
}
//=============
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_GETGLOBALFIELDVALUE(prog->globaloffsets.time)->_float - e->priv.required->freetime) > 0.5 ) )
+ 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 ) )
{
PRVM_ED_ClearEdict (e);
return e;
PRVM_GCALL(free_edict)(ed);
ed->priv.required->free = true;
- ed->priv.required->freetime = prog->globaloffsets.time >= 0 ? PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.time)->_float : 0;
+ ed->priv.required->freetime = prog->globaloffsets.time >= 0 ? PRVM_GLOBALFIELDVALUE(prog->globaloffsets.time)->_float : 0;
}
//===========================================================================
}
// self = ent
- PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.self)->edict = PRVM_EDICT_TO_PROG(ent);
+ PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict = PRVM_EDICT_TO_PROG(ent);
PRVM_ExecuteProgram (func - prog->functions, "");
}
if (!fnum || fnum >= (unsigned int)prog->progs->numfunctions)
{
- if (prog->globaloffsets.self >= 0 && PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
- PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.self)->edict));
+ if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
+ PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict));
PRVM_ERROR ("PRVM_ExecuteProgram: %s", errormessage);
}
case OP_STATE:
if(prog->flag & PRVM_OP_STATE)
{
- ed = PRVM_PROG_TO_EDICT(PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
- PRVM_GETEDICTFIELDVALUE(ed,prog->fieldoffsets.nextthink)->_float = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.time)->_float + 0.1;
- PRVM_GETEDICTFIELDVALUE(ed,prog->fieldoffsets.frame)->_float = OPA->_float;
- PRVM_GETEDICTFIELDVALUE(ed,prog->fieldoffsets.think)->function = OPB->function;
+ ed = PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
+ PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.nextthink)->_float = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.time)->_float + 0.1;
+ PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.frame)->_float = OPA->_float;
+ PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.think)->function = OPB->function;
}
else
{
MSG_WriteByte (&client->netconnection->message, svc_stufftext);
MSG_WriteString (&client->netconnection->message, va("csqc_progcrc %i\n", sv.csqc_progcrc));
//[515]: init stufftext string (it is sent before svc_serverinfo)
- val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.SV_InitCmd);
+ val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.SV_InitCmd);
if (val)
{
MSG_WriteByte (&client->netconnection->message, svc_stufftext);
modelindex = (i >= 1 && i < MAX_MODELS && *PRVM_GetString(ent->fields.server->model)) ? i : 0;
flags = 0;
- i = (int)(PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.glow_size)->_float * 0.25f);
+ i = (int)(PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.glow_size)->_float * 0.25f);
glowsize = (unsigned char)bound(0, i, 255);
- if (PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.glow_trail)->_float)
+ if (PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.glow_trail)->_float)
flags |= RENDER_GLOWTRAIL;
- f = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.color)->vector[0]*256;
+ f = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.color)->vector[0]*256;
light[0] = (unsigned short)bound(0, f, 65535);
- f = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.color)->vector[1]*256;
+ f = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.color)->vector[1]*256;
light[1] = (unsigned short)bound(0, f, 65535);
- f = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.color)->vector[2]*256;
+ f = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.color)->vector[2]*256;
light[2] = (unsigned short)bound(0, f, 65535);
- f = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.light_lev)->_float;
+ f = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.light_lev)->_float;
light[3] = (unsigned short)bound(0, f, 65535);
- lightstyle = (unsigned char)PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.style)->_float;
- lightpflags = (unsigned char)PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.pflags)->_float;
+ lightstyle = (unsigned char)PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.style)->_float;
+ lightpflags = (unsigned char)PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.pflags)->_float;
if (gamemode == GAME_TENEBRAE)
{
// early culling checks
// (final culling is done by SV_MarkWriteEntityStateToClient)
- customizeentityforclient = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.customizeentityforclient)->function;
+ customizeentityforclient = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.customizeentityforclient)->function;
if (!customizeentityforclient)
{
if (e > svs.maxclients && (!modelindex && !specialvisibilityradius))
cs->modelindex = modelindex;
cs->skin = (unsigned)ent->fields.server->skin;
cs->frame = (unsigned)ent->fields.server->frame;
- cs->viewmodelforclient = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.viewmodelforclient)->edict;
- cs->exteriormodelforclient = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.exteriormodeltoclient)->edict;
- cs->nodrawtoclient = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.nodrawtoclient)->edict;
- cs->drawonlytoclient = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.drawonlytoclient)->edict;
+ cs->viewmodelforclient = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.viewmodelforclient)->edict;
+ cs->exteriormodelforclient = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.exteriormodeltoclient)->edict;
+ cs->nodrawtoclient = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.nodrawtoclient)->edict;
+ cs->drawonlytoclient = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.drawonlytoclient)->edict;
cs->customizeentityforclient = customizeentityforclient;
- cs->tagentity = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.tag_entity)->edict;
- cs->tagindex = (unsigned char)PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.tag_index)->_float;
+ cs->tagentity = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.tag_entity)->edict;
+ cs->tagindex = (unsigned char)PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.tag_index)->_float;
cs->glowsize = glowsize;
// don't need to init cs->colormod because the defaultstate did that for us
//cs->colormod[0] = cs->colormod[1] = cs->colormod[2] = 32;
- val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.colormod);
+ val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.colormod);
if (val->vector[0] || val->vector[1] || val->vector[2])
{
i = (int)(val->vector[0] * 32.0f);cs->colormod[0] = bound(0, i, 255);
cs->modelindex = modelindex;
cs->alpha = 255;
- f = (PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.alpha)->_float * 255.0f);
+ f = (PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.alpha)->_float * 255.0f);
if (f)
{
i = (int)f;
cs->alpha = (unsigned char)bound(0, i, 255);
}
// halflife
- f = (PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.renderamt)->_float);
+ f = (PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.renderamt)->_float);
if (f)
{
i = (int)f;
}
cs->scale = 16;
- f = (PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.scale)->_float * 16.0f);
+ f = (PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.scale)->_float * 16.0f);
if (f)
{
i = (int)f;
}
cs->glowcolor = 254;
- f = (PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.glow_color)->_float);
+ f = (PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.glow_color)->_float);
if (f)
cs->glowcolor = (int)f;
- if (PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.fullbright)->_float)
+ if (PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.fullbright)->_float)
cs->effects |= EF_FULLBRIGHT;
if (ent->fields.server->movetype == MOVETYPE_STEP)
// stuff the sigil bits into the high bits of items for sbar, or else
// mix in items2
- val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.items2);
+ val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.items2);
if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE)
items = (int)ent->fields.server->items | ((int)val->_float << 23);
else
items = (int)ent->fields.server->items | ((int)prog->globals.server->serverflags << 28);
VectorClear(punchvector);
- if ((val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.punchvector)))
+ if ((val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.punchvector)))
VectorCopy(val->vector, punchvector);
// cache weapon model name and index in client struct to save time
}
viewzoom = 255;
- if ((val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.viewzoom)))
+ if ((val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.viewzoom)))
viewzoom = (int)(val->_float * 255.0f);
if (viewzoom == 0)
viewzoom = 255;
// DP_SV_CLIENTCOLORS
// this is always found (since it's added by the progs loader)
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.clientcolors)))
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.clientcolors)))
host_client->colors = (int)val->_float;
if (host_client->old_colors != host_client->colors)
{
// NEXUIZ_PLAYERMODEL
if( prog->fieldoffsets.playermodel >= 0 ) {
- model = PRVM_GetString(PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playermodel)->string);
+ model = PRVM_GetString(PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playermodel)->string);
if (model == NULL)
model = "";
// always point the string back at host_client->name to keep it safe
strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
- PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playermodel)->string = PRVM_SetEngineString(host_client->playermodel);
+ PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playermodel)->string = PRVM_SetEngineString(host_client->playermodel);
}
// NEXUIZ_PLAYERSKIN
if( prog->fieldoffsets.playerskin >= 0 ) {
- skin = PRVM_GetString(PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playerskin)->string);
+ skin = PRVM_GetString(PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playerskin)->string);
if (skin == NULL)
skin = "";
// always point the string back at host_client->name to keep it safe
strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
- PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playerskin)->string = PRVM_SetEngineString(host_client->playerskin);
+ PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.playerskin)->string = PRVM_SetEngineString(host_client->playerskin);
}
// frags
// DP_SV_CLIENTNAME and DP_SV_CLIENTCOLORS will not immediately
// reset them
e->fields.server->netname = PRVM_SetEngineString(svs.clients[num].name);
- if ((val = PRVM_GETEDICTFIELDVALUE(e, prog->fieldoffsets.clientcolors)))
+ if ((val = PRVM_EDICTFIELDVALUE(e, prog->fieldoffsets.clientcolors)))
val->_float = svs.clients[num].colors;
// NEXUIZ_PLAYERMODEL and NEXUIZ_PLAYERSKIN
if( prog->fieldoffsets.playermodel >= 0 )
- PRVM_GETEDICTFIELDVALUE(e, prog->fieldoffsets.playermodel)->string = PRVM_SetEngineString(svs.clients[num].playermodel);
+ PRVM_EDICTFIELDVALUE(e, prog->fieldoffsets.playermodel)->string = PRVM_SetEngineString(svs.clients[num].playermodel);
if( prog->fieldoffsets.playerskin >= 0 )
- PRVM_GETEDICTFIELDVALUE(e, prog->fieldoffsets.playerskin)->string = PRVM_SetEngineString(svs.clients[num].playerskin);
+ PRVM_EDICTFIELDVALUE(e, prog->fieldoffsets.playerskin)->string = PRVM_SetEngineString(svs.clients[num].playerskin);
}
}
if (passedict)
{
- val = PRVM_GETEDICTFIELDVALUE(passedict, prog->fieldoffsets.dphitcontentsmask);
+ val = PRVM_EDICTFIELDVALUE(passedict, prog->fieldoffsets.dphitcontentsmask);
if (val && val->_float)
hitsupercontentsmask = (int)val->_float;
else if (passedict->fields.server->solid == SOLID_SLIDEBOX)
VectorSet (prog->globals.server->trace_plane_normal, 0, 0, 1);
prog->globals.server->trace_plane_dist = 0;
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(ent);
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
val->_float = 0;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
val->_float = 0;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
val->_float = 0;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
val->string = 0;
PRVM_ExecuteProgram (touch->fields.server->touch, "QC function self.touch is missing");
}
if(ent->fields.server->watertype != nContents)
{ // Changed Contents
// Acquire Contents Transition Function from QC
- contentstransition = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.contentstransition);
+ contentstransition = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.contentstransition);
if(contentstransition->function)
{ // Valid Function; Execute
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(trace->ent);
else
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(prog->edicts);
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
val->_float = trace->startsupercontents;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
val->_float = trace->hitsupercontents;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
val->_float = trace->hitq3surfaceflags;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
{
if (trace->hittexture)
val->string = PRVM_SetTempString(trace->hittexture->name);
VectorSet (prog->globals.server->trace_plane_normal, 0, 0, 1);
prog->globals.server->trace_plane_dist = 0;
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(e1);
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
val->_float = 0;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
val->_float = 0;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
val->_float = 0;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
val->string = 0;
PRVM_ExecuteProgram (e2->fields.server->touch, "QC function self.touch is missing");
}
float ent_gravity;
prvm_eval_t *val;
- val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.gravity);
+ val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.gravity);
if (val!=0 && val->_float)
ent_gravity = val->_float;
else
VectorCopy(tossent->fields.server->angles , original_angles );
VectorCopy(tossent->fields.server->avelocity, original_avelocity);
- val = PRVM_GETEDICTFIELDVALUE(tossent, prog->fieldoffsets.gravity);
+ val = PRVM_EDICTFIELDVALUE(tossent, prog->fieldoffsets.gravity);
if (val != NULL && val->_float != 0)
gravity = val->_float;
else
len = 0;
VectorScale (host_client->edict->fields.server->punchangle, len, host_client->edict->fields.server->punchangle);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.punchvector)))
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.punchvector)))
{
len = VectorNormalizeLength (val->vector);
// only send the impulse to qc once
move->impulse = 0;
VectorCopy(move->viewangles, host_client->edict->fields.server->v_angle);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button3))) val->_float = ((move->buttons >> 2) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button4))) val->_float = ((move->buttons >> 3) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button5))) val->_float = ((move->buttons >> 4) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button6))) val->_float = ((move->buttons >> 5) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button7))) val->_float = ((move->buttons >> 6) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button8))) val->_float = ((move->buttons >> 7) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button9))) val->_float = ((move->buttons >> 11) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button10))) val->_float = ((move->buttons >> 12) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button11))) val->_float = ((move->buttons >> 13) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button12))) val->_float = ((move->buttons >> 14) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button13))) val->_float = ((move->buttons >> 15) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button14))) val->_float = ((move->buttons >> 16) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button15))) val->_float = ((move->buttons >> 17) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button16))) val->_float = ((move->buttons >> 18) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.buttonuse))) val->_float = ((move->buttons >> 8) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.buttonchat))) val->_float = ((move->buttons >> 9) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_active))) val->_float = ((move->buttons >> 10) & 1);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.movement))) VectorSet(val->vector, move->forwardmove, move->sidemove, move->upmove);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_screen))) VectorCopy(move->cursor_screen, val->vector);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_trace_start))) VectorCopy(move->cursor_start, val->vector);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_trace_endpos))) VectorCopy(move->cursor_impact, val->vector);
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_trace_ent))) val->edict = PRVM_EDICT_TO_PROG(PRVM_EDICT_NUM(move->cursor_entitynumber));
- if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ping))) val->_float = host_client->ping * 1000.0;
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button3))) val->_float = ((move->buttons >> 2) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button4))) val->_float = ((move->buttons >> 3) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button5))) val->_float = ((move->buttons >> 4) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button6))) val->_float = ((move->buttons >> 5) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button7))) val->_float = ((move->buttons >> 6) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button8))) val->_float = ((move->buttons >> 7) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button9))) val->_float = ((move->buttons >> 11) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button10))) val->_float = ((move->buttons >> 12) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button11))) val->_float = ((move->buttons >> 13) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button12))) val->_float = ((move->buttons >> 14) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button13))) val->_float = ((move->buttons >> 15) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button14))) val->_float = ((move->buttons >> 16) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button15))) val->_float = ((move->buttons >> 17) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.button16))) val->_float = ((move->buttons >> 18) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.buttonuse))) val->_float = ((move->buttons >> 8) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.buttonchat))) val->_float = ((move->buttons >> 9) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_active))) val->_float = ((move->buttons >> 10) & 1);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.movement))) VectorSet(val->vector, move->forwardmove, move->sidemove, move->upmove);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_screen))) VectorCopy(move->cursor_screen, val->vector);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_trace_start))) VectorCopy(move->cursor_start, val->vector);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_trace_endpos))) VectorCopy(move->cursor_impact, val->vector);
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.cursor_trace_ent))) val->edict = PRVM_EDICT_TO_PROG(PRVM_EDICT_NUM(move->cursor_entitynumber));
+ if ((val = PRVM_EDICTFIELDVALUE(host_client->edict, prog->fieldoffsets.ping))) val->_float = host_client->ping * 1000.0;
}
void SV_FrameLost(int framenum)
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(trace.ent);
else
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(prog->edicts);
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
val->_float = trace.startsupercontents;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
val->_float = trace.hitsupercontents;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
val->_float = trace.hitq3surfaceflags;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
{
if (trace.hittexture)
val->string = PRVM_SetTempString(trace.hittexture->name);
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(trace.ent);
else
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(prog->edicts);
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
val->_float = trace.startsupercontents;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
val->_float = trace.hitsupercontents;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
val->_float = trace.hitq3surfaceflags;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
{
if (trace.hittexture)
val->string = PRVM_SetTempString(trace.hittexture->name);
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(trace.ent);
else
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(prog->edicts);
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
val->_float = trace.startsupercontents;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
val->_float = trace.hitsupercontents;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
val->_float = trace.hitq3surfaceflags;
- if ((val = PRVM_GETGLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
{
if (trace.hittexture)
val->string = PRVM_SetTempString(trace.hittexture->name);
client = svs.clients + entnum-1;
if (client->edict)
{
- if ((val = PRVM_GETEDICTFIELDVALUE(client->edict, prog->fieldoffsets.clientcolors)))
+ if ((val = PRVM_EDICTFIELDVALUE(client->edict, prog->fieldoffsets.clientcolors)))
val->_float = i;
client->edict->fields.server->team = (i & 15) + 1;
}
if (tagentity == NULL)
tagentity = prog->edicts;
- v = PRVM_GETEDICTFIELDVALUE(e, prog->fieldoffsets.tag_entity);
+ v = PRVM_EDICTFIELDVALUE(e, prog->fieldoffsets.tag_entity);
if (v)
v->edict = PRVM_EDICT_TO_PROG(tagentity);
- v = PRVM_GETEDICTFIELDVALUE(e, prog->fieldoffsets.tag_index);
+ v = PRVM_EDICTFIELDVALUE(e, prog->fieldoffsets.tag_index);
if (v)
v->_float = 0;
if (tagentity != NULL && tagentity != prog->edicts && tagname && tagname[0])
void SV_GetEntityMatrix (prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatrix)
{
- float scale = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.scale)->_float;
+ float scale = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.scale)->_float;
if (scale == 0)
scale = 1;
if (viewmatrix)
SV_GetEntityMatrix(ent, &entitymatrix, false);
Matrix4x4_Concat(&tagmatrix, &entitymatrix, out);
// next iteration we process the parent entity
- if ((val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.tag_entity)) && val->edict)
+ if ((val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.tag_entity)) && val->edict)
{
- tagindex = (int)PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.tag_index)->_float;
+ tagindex = (int)PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.tag_index)->_float;
ent = PRVM_EDICT_NUM(val->edict);
}
else
}
// RENDER_VIEWMODEL magic
- if ((val = PRVM_GETEDICTFIELDVALUE(ent, prog->fieldoffsets.viewmodelforclient)) && val->edict)
+ if ((val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.viewmodelforclient)) && val->edict)
{
Matrix4x4_Copy(&tagmatrix, out);
ent = PRVM_EDICT_NUM(val->edict);