int num_pings;
// LordHavoc: can be used for prediction or whatever...
float ping;
- // LordHavoc: specifically used for prediction, accounts for sys_ticrate too
- float latency;
// spawn parms are carried from level to level
float spawn_parms[NUM_SPAWN_PARMS];
extern cvar_t sv_accelerate;
extern cvar_t sv_idealpitchscale;
extern cvar_t sv_aim;
-extern cvar_t sv_predict;
extern cvar_t sv_stepheight;
extern cvar_t sv_jumpstep;
Cvar_RegisterVariable (&sv_idealpitchscale);
Cvar_RegisterVariable (&sv_aim);
Cvar_RegisterVariable (&sv_nostep);
- Cvar_RegisterVariable (&sv_predict);
Cvar_RegisterVariable (&sv_deltacompress);
Cvar_RegisterVariable (&sv_cullentities_pvs);
Cvar_RegisterVariable (&sv_cullentities_portal);
}
VectorCopy(ent->v->angles, angles);
- if (DotProduct(ent->v->velocity, ent->v->velocity) >= 1.0f)
- {
- VectorMA(ent->v->origin, host_client->latency, ent->v->velocity, origin);
- // LordHavoc: trace predicted movement to avoid putting things in walls
- trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, origin, MOVE_NORMAL, ent);
- VectorCopy(trace.endpos, origin);
- }
- else
- {
- VectorCopy(ent->v->origin, origin);
- }
+ VectorCopy(ent->v->origin, origin);
// ent has survived every check so far, check if it is visible
if (ent != clent && ((bits & U_VIEWMODEL) == 0))
}
VectorCopy(ent->v->angles, angles);
- if (DotProduct(ent->v->velocity, ent->v->velocity) >= 1.0f && host_client->latency >= 0.01f)
- {
- VectorMA(ent->v->origin, host_client->latency, ent->v->velocity, origin);
- // LordHavoc: trace predicted movement to avoid putting things in walls
- trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, origin, MOVE_NORMAL, ent);
- VectorCopy(trace.endpos, origin);
- }
- else
- {
- VectorCopy(ent->v->origin, origin);
- }
+ VectorCopy(ent->v->origin, origin);
// ent has survived every check so far, check if it is visible
// always send embedded brush models, they don't generate much traffic
edict_t *sv_player;
cvar_t sv_edgefriction = {0, "edgefriction", "2"};
-cvar_t sv_predict = {0, "sv_predict", "1"};
cvar_t sv_deltacompress = {0, "sv_deltacompress", "1"};
cvar_t sv_idealpitchscale = {0, "sv_idealpitchscale","0.8"};
cvar_t sv_maxspeed = {CVAR_NOTIFY, "sv_maxspeed", "320"};
total += host_client->ping_times[i];
// can be used for prediction
host_client->ping = total / NUM_PING_TIMES;
- host_client->latency = 0;
- // if paused or a local game, don't predict
- if (sv_predict.integer && (svs.maxclients > 1) && (!sv.paused))
- host_client->latency = host_client->ping;
if ((val = GETEDICTFIELDVALUE(sv_player, eval_ping)))
val->_float = host_client->ping * 1000.0;