//
for (i=0 ; i<3 ; i++)
{
- if (PRVM_IS_NAN(PRVM_serveredictvector(ent, velocity)[i]))
+ if (isnan(PRVM_serveredictvector(ent, velocity)[i]))
{
Con_Printf("Got a NaN velocity on entity #%i (%s)\n", PRVM_NUM_FOR_EDICT(ent), PRVM_GetString(prog, PRVM_serveredictstring(ent, classname)));
PRVM_serveredictvector(ent, velocity)[i] = 0;
}
- if (PRVM_IS_NAN(PRVM_serveredictvector(ent, origin)[i]))
+ if (isnan(PRVM_serveredictvector(ent, origin)[i]))
{
Con_Printf("Got a NaN origin on entity #%i (%s)\n", PRVM_NUM_FOR_EDICT(ent), PRVM_GetString(prog, PRVM_serveredictstring(ent, classname)));
PRVM_serveredictvector(ent, origin)[i] = 0;
static int SV_FlyMove (prvm_edict_t *ent, float time, qbool applygravity, float *stepnormal, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float stepheight)
{
prvm_prog_t *prog = SVVM_prog;
- int blocked, bumpcount;
- int i, j, numplanes;
+ unsigned int i, j, numplanes, blocked, bumpcount;
float d, time_left, gravity;
vec3_t dir, push, planes[MAX_CLIP_PLANES];
prvm_vec3_t primal_velocity, original_velocity, new_velocity, restore_velocity;
if (stepnormal)
VectorCopy(trace.plane.normal, stepnormal);
}
+
+ // Unlike some other movetypes Quake's SV_FlyMove calls SV_Impact only after setting ONGROUND which id1 fiends rely on.
+ // If we stepped up (sv_gameplayfix_stepmultipletimes) this will impact the steptrace2 plane instead of the original.
+ if (PRVM_serveredictfloat(ent, solid) >= SOLID_TRIGGER && trace.ent)
+ SV_Impact(ent, &trace);
+ if (ent->free)
+ return blocked; // removed by the impact function
+
if (trace.fraction >= 0.001)
{
// actually covered some distance
#endif
if (dolink)
+ {
SV_LinkEdict_TouchAreaGrid(ent);
- if((PRVM_serveredictfloat(ent, solid) >= SOLID_TRIGGER && trace->ent && (!((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND) || PRVM_serveredictedict(ent, groundentity) != PRVM_EDICT_TO_PROG(trace->ent))))
- SV_Impact (ent, trace);
+ if((PRVM_serveredictfloat(ent, solid) >= SOLID_TRIGGER && trace->ent && (!((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND) || PRVM_serveredictedict(ent, groundentity) != PRVM_EDICT_TO_PROG(trace->ent))))
+ SV_Impact (ent, trace);
+ }
if(ent->priv.required->mark == PRVM_EDICT_MARK_SETORIGIN_CAUGHT)
{
}
}
+// asynchronous path
void SV_Physics_ClientMove(void)
{
prvm_prog_t *prog = SVVM_prog;