fireBullet_last_hit = NULL;
}
-void fireBullet(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, entity tracer_effect)
+void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, entity tracer_effect, bool do_antilag)
{
dir = normalize(dir + randomvec() * spread);
vector end = start + dir * max_shot_distance;
float damage_fraction = 1;
float total_damage = 0;
- float lag = ((IS_REAL_CLIENT(this)) ? ANTILAG_LATENCY(this) : 0);
- if(lag < 0.001)
- lag = 0;
- bool noantilag = ((IS_CLIENT(this)) ? CS(this).cvar_cl_noantilag : false);
- if(autocvar_g_antilag == 0 || noantilag)
- lag = 0; // only do hitscan, but no antilag
+ float lag = ((do_antilag) ? antilag_getlag(this) : 0);
if(lag)
antilag_takeback_all(this, lag);
if(this)
this.dphitcontentsmask = oldsolid;
}
+
+void fireBullet(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, entity tracer_effect)
+{
+ fireBullet_antilag(this, weaponentity, start, dir, spread, max_solid_penetration, damage, force, dtype, tracer_effect, true);
+}