28 if (
time < store.antilag_times[store.antilag_index])
return;
29 store.antilag_index += 1;
31 store.antilag_index = 0;
32 store.antilag_times[store.antilag_index] = t;
33 store.antilag_origins[store.antilag_index] = e.origin;
35 if (store.antilag_debug)
42 for(
int i = store.antilag_index; i > 0; --i)
43 if(store.antilag_times[i] >= t)
44 if(store.antilag_times[i - 1] < t)
47 if(store.antilag_times[0] >= t)
52 if(store.antilag_times[i] >= t)
53 if(store.antilag_times[i - 1] < t)
66 if(store.antilag_takenback)
67 return store.antilag_saved_origin;
75 return lerpv(store.antilag_times[i0], store.antilag_origins[i0], store.antilag_times[i1], store.antilag_origins[i1], t);
80 if (t0 >= t1)
return '0 0 0';
83 return (o1 - o0) * (1 / (t1 - t0));
93 if (!store.antilag_takenback)
94 store.antilag_saved_origin = e.origin;
98 store.antilag_takenback =
true;
108 if (!store.antilag_takenback)
return;
110 setorigin(e, store.antilag_saved_origin);
111 store.antilag_takenback =
false;
118 store.antilag_times[i] = -2342;
119 store.antilag_origins[i] = e.origin;
121 store.antilag_index = ANTILAG_MAX_ORIGINS - 1;
134 antilag_takeback(it, it, time - lag);
147 antilag_restore(it, it);
178 int oldsolid = source.dphitcontentsmask;
189 tracebox (v1, mi, ma, v2, nomonst, forent);
197 source.dphitcontentsmask = oldsolid;
205 bool noantilag = ((
IS_CLIENT(source)) ?
CS_CVAR(source).cvar_cl_noantilag :
false);
212 bool noantilag = ((
IS_CLIENT(source)) ?
CS_CVAR(source).cvar_cl_noantilag :
false);
223 bool noantilag = ((
IS_CLIENT(source)) ?
CS_CVAR(source).cvar_cl_noantilag :
false);
230 bool noantilag = ((
IS_CLIENT(source)) ?
CS_CVAR(source).cvar_cl_noantilag :
false);
#define IL_EACH(this, cond, body)
vector antilag_origins[ANTILAG_MAX_ORIGINS]
const int VHF_PLAYERSLOT
Vehicle has multiple player slots.
ERASEABLE vector lerpv(float t0, vector v0, float t1, vector v1, float t)
void tracebox_antilag(entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
void WarpZone_TraceBox(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent)
vector antilag_saved_origin
float antilag_getlag(entity e)
ClientState CS(Client this)
#define FOREACH_CLIENT(cond, body)
void WarpZone_traceline_antilag_force(entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
float antilag_times[ANTILAG_MAX_ORIGINS]
void tracebox_antilag_force_wz(entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag, float wz)
float antilag_find(entity e, entity store, float t)
void antilag_clear(entity e, entity store)
#define IS_REAL_CLIENT(v)
void WarpZone_traceline_antilag(entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
void antilag_restore_all(entity ignore)
void antilag_takeback(entity e, entity store, float t)
void antilag_restore(entity e, entity store)
void traceline_antilag_force(entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void antilag_record(entity e, entity store, float t)
IntrusiveList g_projectiles
#define ANTILAG_LATENCY(e)
void WarpZone_tracebox_antilag(entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
vector antilag_takebackavgvelocity(entity e, entity store, float t0, float t1)
void antilag_takeback_all(entity ignore, float lag)
void traceline_antilag(entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
const int ANTILAG_MAX_ORIGINS
vector antilag_takebackorigin(entity e, entity store, float t)