// make sure you call makevectors first (FIXME?)
void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float chan, float maxdamage, float range)
{
- float nudge = 1; // added to traceline target and subtracted from result
+ float nudge = 1; // added to traceline target and subtracted from result TOOD(divVerent): do we still need this? Doesn't the engine do this now for us?
float oldsolid;
vector vecs, dv;
oldsolid = ent.dphitcontentsmask;
// calculate the shotdir from the chosen shotorg
w_shotdir = normalize(w_shotend - w_shotorg);
+ //vector prevdir = w_shotdir;
+ //vector prevorg = w_shotorg;
+ //vector prevend = w_shotend;
+
if (antilag)
if (!ent.cvar_cl_noantilag)
{
// nudge w_shotend so a trace to w_shotend hits
w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
+ //if(w_shotend != prevend) { printf("SERVER: shotEND differs: %s - %s\n", vtos(w_shotend), vtos(prevend)); }
+ //if(w_shotorg != prevorg) { printf("SERVER: shotORG differs: %s - %s\n", vtos(w_shotorg), vtos(prevorg)); }
+ //if(w_shotdir != prevdir) { printf("SERVER: shotDIR differs: %s - %s\n", vtos(w_shotdir), vtos(prevdir)); }
}
vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float forceAbsolute)
if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
lag = 0; // only do hitscan, but no antilag
if(lag)
+ {
FOR_EACH_PLAYER(pl)
if(pl != self)
antilag_takeback(pl, time - lag);
+ FOR_EACH_MONSTER(pl)
+ antilag_takeback(pl, time - lag);
+ }
WarpZone_trace_forent = self;
}
if(lag)
+ {
FOR_EACH_PLAYER(pl)
if(pl != self)
antilag_restore(pl);
+ FOR_EACH_MONSTER(pl)
+ antilag_restore(pl);
+ }
}