model->type == mod_alias
:
(
- (((unsigned char)PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.pflags)->_float) & PFLAGS_FULLDYNAMIC)
+ (((unsigned char)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.pflags)) & PFLAGS_FULLDYNAMIC)
||
((gamemode == GAME_TENEBRAE) && ((unsigned int)ent->fields.server->effects & (16 | 32)))
)
int SV_GenericHitSuperContentsMask(const prvm_edict_t *passedict)
{
- prvm_eval_t *val;
if (passedict)
{
- val = PRVM_EDICTFIELDVALUE(passedict, prog->fieldoffsets.dphitcontentsmask);
- if (val && val->_float)
- return (int)val->_float;
+ int dphitcontentsmask = (int)PRVM_EDICTFIELDFLOAT(passedict, prog->fieldoffsets.dphitcontentsmask);
+ if (dphitcontentsmask)
+ return dphitcontentsmask;
else if (passedict->fields.server->solid == SOLID_SLIDEBOX)
{
if ((int)passedict->fields.server->flags & FL_MONSTER)
#endif
// clip to world
- Collision_ClipLineToWorld(&cliptrace, sv.worldmodel, clipstart, clipend, hitsupercontentsmask);
+ Collision_ClipLineToWorld(&cliptrace, sv.worldmodel, clipstart, clipend, hitsupercontentsmask, false);
cliptrace.bmodelstartsolid = cliptrace.startsolid;
if (cliptrace.startsolid || cliptrace.fraction < 1)
cliptrace.ent = prog->edicts;
if (type == MOVE_MISSILE && (int)touch->fields.server->flags & FL_MONSTER)
Collision_ClipToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins2, clipmaxs2, clipend, hitsupercontentsmask);
else
- Collision_ClipLineToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipend, hitsupercontentsmask);
+ Collision_ClipLineToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipend, hitsupercontentsmask, false);
Collision_CombineTraces(&cliptrace, &trace, (void *)touch, touch->fields.server->solid == SOLID_BSP);
}
void SV_LinkEdict_TouchAreaGrid_Call(prvm_edict_t *touch, prvm_edict_t *ent)
{
- prvm_eval_t *val;
prog->globals.server->self = PRVM_EDICT_TO_PROG(touch);
prog->globals.server->other = PRVM_EDICT_TO_PROG(ent);
prog->globals.server->time = sv.time;
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_GLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
- val->_float = 0;
- if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
- val->_float = 0;
- if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
- val->_float = 0;
- if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
- val->string = 0;
+ PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.trace_dpstartcontents) = 0;
+ PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.trace_dphitcontents) = 0;
+ PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.trace_dphitq3surfaceflags) = 0;
+ PRVM_GLOBALFIELDSTRING(prog->globaloffsets.trace_dphittexturename) = 0;
PRVM_ExecuteProgram (touch->fields.server->touch, "QC function self.touch is missing");
}
int SV_CheckContentsTransition(prvm_edict_t *ent, const int nContents)
{
int bValidFunctionCall;
- prvm_eval_t *contentstransition;
// Default Valid Function Call to False
bValidFunctionCall = false;
if(ent->fields.server->watertype != nContents)
{ // Changed Contents
// Acquire Contents Transition Function from QC
- contentstransition = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.contentstransition);
-
- if(contentstransition->function)
+ if(PRVM_EDICTFIELDFUNCTION(ent, prog->fieldoffsets.contentstransition))
{ // Valid Function; Execute
// Assign Valid Function
bValidFunctionCall = true;
// Assign Self
prog->globals.server->self = PRVM_EDICT_TO_PROG(ent);
// Execute VM Function
- PRVM_ExecuteProgram(contentstransition->function, "contentstransition: NULL function");
+ PRVM_ExecuteProgram(PRVM_EDICTFIELDFUNCTION(ent, prog->fieldoffsets.contentstransition), "contentstransition: NULL function");
}
}
int restorevm_tempstringsbuf_cursize;
int old_self, old_other;
prvm_edict_t *e2 = (prvm_edict_t *)trace->ent;
- prvm_eval_t *val;
old_self = prog->globals.server->self;
old_other = prog->globals.server->other;
VectorNegate(trace->plane.normal, prog->globals.server->trace_plane_normal);
prog->globals.server->trace_plane_dist = -trace->plane.dist;
prog->globals.server->trace_ent = PRVM_EDICT_TO_PROG(e1);
- if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dpstartcontents)))
- val->_float = 0;
- if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitcontents)))
- val->_float = 0;
- if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphitq3surfaceflags)))
- val->_float = 0;
- if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_dphittexturename)))
- val->string = 0;
+ PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.trace_dpstartcontents) = 0;
+ PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.trace_dphitcontents) = 0;
+ PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.trace_dphitq3surfaceflags) = 0;
+ PRVM_GLOBALFIELDSTRING(prog->globaloffsets.trace_dphittexturename) = 0;
PRVM_ExecuteProgram (e2->fields.server->touch, "QC function self.touch is missing");
}
static float SV_Gravity (prvm_edict_t *ent)
{
float ent_gravity;
- prvm_eval_t *val;
- val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.gravity);
- if (val!=0 && val->_float)
- ent_gravity = val->_float;
- else
- ent_gravity = 1.0;
+ ent_gravity = PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.gravity);
+ if (!ent_gravity)
+ ent_gravity = 1.0f;
return ent_gravity * sv_gravity.value * sv.frametime;
}
movetime *= 1 - min(1, trace.fraction);
if (ent->fields.server->movetype == MOVETYPE_BOUNCEMISSILE)
{
- prvm_eval_t *val;
- float bouncefactor = 1.0f;
- val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.bouncefactor);
- if (val!=0 && val->_float)
- bouncefactor = val->_float;
+ float bouncefactor;
+ bouncefactor = PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.bouncefactor);
+ if (!bouncefactor)
+ bouncefactor = 1.0f;
ClipVelocity (ent->fields.server->velocity, trace.plane.normal, ent->fields.server->velocity, 1 + bouncefactor);
ent->fields.server->flags = (int)ent->fields.server->flags & ~FL_ONGROUND;
else if (ent->fields.server->movetype == MOVETYPE_BOUNCE)
{
float d, ent_gravity;
- prvm_eval_t *val;
- float bouncefactor = 0.5f;
- float bouncestop = 60.0f / 800.0f;
+ float bouncefactor;
+ float bouncestop;
- val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.bouncefactor);
- if (val!=0 && val->_float)
- bouncefactor = val->_float;
+ bouncefactor = PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.bouncefactor);
+ if (!bouncefactor)
+ bouncefactor = 0.5f;
- val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.bouncestop);
- if (val!=0 && val->_float)
- bouncestop = val->_float;
+ bouncestop = PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.bouncestop);
+ if (!bouncestop)
+ bouncestop = 60.0f / 800.0f;
ClipVelocity (ent->fields.server->velocity, trace.plane.normal, ent->fields.server->velocity, 1 + bouncefactor);
+ ent_gravity = PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.gravity);
+ if (!ent_gravity)
+ ent_gravity = 1.0f;
// LordHavoc: fixed grenades not bouncing when fired down a slope
- val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.gravity);
- if (val!=0 && val->_float)
- ent_gravity = val->_float;
- else
- ent_gravity = 1.0;
if (sv_gameplayfix_grenadebouncedownslopes.integer)
{
d = DotProduct(trace.plane.normal, ent->fields.server->velocity);
// DRESK
// Backup Velocity in the event that movetypesteplandevent is called,
// to provide a parameter with the entity's velocity at impact.
- prvm_eval_t *movetypesteplandevent;
vec3_t backupVelocity;
VectorCopy(ent->fields.server->velocity, backupVelocity);
// don't fall at all if fly/swim
if (hitsound && (int)ent->fields.server->flags & FL_ONGROUND)
{
// DRESK - Check for Entity Land Event Function
- movetypesteplandevent = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.movetypesteplandevent);
-
- if(movetypesteplandevent->function)
+ if(PRVM_EDICTFIELDFUNCTION(ent, prog->fieldoffsets.movetypesteplandevent))
{ // Valid Function; Execute
// Prepare Parameters
// Assign Velocity at Impact
// Assign Self
prog->globals.server->self = PRVM_EDICT_TO_PROG(ent);
// Execute VM Function
- PRVM_ExecuteProgram(movetypesteplandevent->function, "movetypesteplandevent: NULL function");
+ PRVM_ExecuteProgram(PRVM_EDICTFIELDFUNCTION(ent, prog->fieldoffsets.movetypesteplandevent), "movetypesteplandevent: NULL function");
}
else
// Check for Engine Landing Sound