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)
{
- vector end;
-
dir = normalize(dir + randomvec() * spread);
- end = start + dir * max_shot_distance;
+ vector end = start + dir * max_shot_distance;
fireBullet_last_hit = NULL;
fireBullet_trace_callback_eff = tracer_effect;
- float solid_penetration_left = 1;
+ float solid_penetration_fraction = 1;
+ 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);