#endif
/* crosshair */ ATTRIB(Shockwave, w_crosshair, string, "gfx/crosshairshotgun");
/* crosshair */ ATTRIB(Shockwave, w_crosshair_size, float, 0.7);
-/* wepimg */ ATTRIB(Shockwave, model2, string, "weaponshotgun");
+/* wepimg */ ATTRIB(Shockwave, model2, string, "weaponshockwave");
/* refname */ ATTRIB(Shockwave, netname, string, "shockwave");
/* wepname */ ATTRIB(Shockwave, m_name, string, _("Shockwave"));
// draw lightning beams for debugging
#ifdef DEBUG_SHOCKWAVE
- te_lightning2(world, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
+ te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
te_customflash(targpos, 40, 2, '1 1 1');
#endif
false
);
+ float lag = ANTILAG_LATENCY(actor);
+ if(lag < 0.001)
+ lag = 0;
+ if (!IS_REAL_CLIENT(actor))
+ lag = 0;
+ if(autocvar_g_antilag == 0 || actor.cvar_cl_noantilag)
+ lag = 0; // only do hitscan, but no antilag
+ if(lag)
+ {
+ FOREACH_CLIENT(IS_PLAYER(it) && it != actor, antilag_takeback(it, CS(it), time - lag));
+ FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
+ if (it != actor)
+ antilag_takeback(it, it, time - lag);
+ });
+ }
+
while(head)
{
if(head.takedamage)
// figure out the direction of force
final_force = (w_shotdir * WEP_CVAR(shockwave, blast_splash_force_forwardbias));
final_force = normalize(CENTER_OR_VIEWOFS(head) - (attack_hitpos - final_force));
- //te_lightning2(world, attack_hitpos, (attack_hitpos + (final_force * 200)));
+ //te_lightning2(NULL, attack_hitpos, (attack_hitpos + (final_force * 200)));
// now multiply the direction by force units
final_force *= (WEP_CVAR(shockwave, blast_splash_force) * multiplier);
// figure out the direction of force
final_force = (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias));
final_force = normalize(center - (nearest_on_line - final_force));
- //te_lightning2(world, nearest_on_line, (attack_hitpos + (final_force * 200)));
+ //te_lightning2(NULL, nearest_on_line, (attack_hitpos + (final_force * 200)));
// now multiply the direction by force units
final_force *= (WEP_CVAR(shockwave, blast_force) * multiplier);
final_force
);
- if(accuracy_isgooddamage(actor.realowner, head))
- {
- LOG_INFO("wtf\n");
- accuracy_add(actor.realowner, WEP_SHOCKWAVE.m_id, 0, final_damage);
- }
+ if(accuracy_isgooddamage(actor, head))
+ accuracy_add(actor, WEP_SHOCKWAVE.m_id, 0, final_damage);
#ifdef DEBUG_SHOCKWAVE
LOG_INFO(sprintf(
));
#endif
- shockwave_hit[i-1] = world;
+ shockwave_hit[i-1] = NULL;
shockwave_hit_force[i-1] = '0 0 0';
shockwave_hit_damage[i-1] = 0;
}
+
+ if(lag)
+ {
+ FOREACH_CLIENT(IS_PLAYER(it) && it != actor, antilag_restore(it, CS(it)));
+ FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
+ if (it != actor)
+ antilag_restore(it, it);
+ });
+ }
}
METHOD(Shockwave, wr_aim, void(entity thiswep, entity actor))
deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z)));
new_min_dist = SW_DISTTOMIN;
new_min_end = (this.sw_shotorg + (deviation * new_min_dist));
- //te_lightning2(world, new_min_end, this.sw_shotorg);
+ //te_lightning2(NULL, new_min_end, this.sw_shotorg);
// then calculate spread_to_max effect
deviation = angle * spread_to_max;
deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z)));
new_max_dist = vlen(new_min_end - endpos);
new_max_end = (new_min_end + (deviation * new_max_dist));
- //te_lightning2(world, new_end, prev_min_end);
+ //te_lightning2(NULL, new_end, prev_min_end);
if(counter == 0)