Now the w_backoff factor is 2 for all weapons, except for the hook (-2) whose bomb explodes slightly below the floor
w_random = prandom();
vector force_dir = normalize(force);
+ // this traceline usually starts in solid when a hitscan shot hits a surface with a very small angle
+ // if so, try another traceline starting further back (may still start in solid but only with extremely small angles)
traceline(w_org - force_dir * 16, w_org + force_dir * 16, MOVE_NOMONSTERS, NULL);
- if(trace_fraction < 1 && !(hitwep.spawnflags & WEP_TYPE_HITSCAN))
+ if(trace_startsolid)
+ traceline(w_org - force_dir * 40, w_org + force_dir * 16, MOVE_NOMONSTERS, NULL);
+ if(trace_fraction < 1)
w_backoff = trace_plane_normal;
else
w_backoff = -force_dir;
METHOD(OverkillHeavyMachineGun, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 2;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
METHOD(OverkillMachineGun, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 2;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
METHOD(OverkillNex, wr_impacteffect, void(entity thiswep, entity actor))
{
entity this = actor;
- vector org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
if(!w_issilent)
sound(this, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);
METHOD(OverkillRocketPropelledChainsaw, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 12;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
{
if(w_deathtype & HITTYPE_SECONDARY)
{
- vector org2;
- org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_ELECTRO_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent) { sound(actor, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTN_NORM); }
}
METHOD(Blaster, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
}
#ifdef CSQC
METHOD(Crylink, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 2;
+ vector org2 = w_org + w_backoff * 2;
if(w_deathtype & HITTYPE_SECONDARY)
{
pointparticles(EFFECT_CRYLINK_IMPACT2, org2, '0 0 0', 1);
METHOD(Devastator, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 12;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);
METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
if(w_deathtype & HITTYPE_SECONDARY)
{
pointparticles(EFFECT_ELECTRO_BALLEXPLODE, org2, '0 0 0', 1);
METHOD(Fireball, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
if(w_deathtype & HITTYPE_SECONDARY)
{
// firemine goes out silently
}
else
{
- org2 = w_org + w_backoff * 16;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_FIREBALL_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
METHOD(Hagar, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
{
METHOD(HLAC, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM);
METHOD(Hook, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 2;
+ vector org2 = w_org + w_backoff * -2;
pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
METHOD(MachineGun, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 2;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
METHOD(MineLayer, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 12;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM);
METHOD(Mortar, wr_impacteffect, void(entity thiswep, entity actor))
{
- pointparticles(EFFECT_GRENADE_EXPLODE, w_org + w_backoff, '0 0 0', 1);
+ vector org2 = w_org + w_backoff * 2;
+ pointparticles(EFFECT_GRENADE_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(actor, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM);
}
METHOD(Rifle, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 2;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
{
METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2;
- org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
if(w_deathtype & HITTYPE_BOUNCE)
{
if(w_deathtype & HITTYPE_SECONDARY)
METHOD(Shockwave, wr_impacteffect, void(entity thiswep, entity actor))
{
// handled by Net_ReadShockwaveParticle
- //vector org2;
- //org2 = w_org + w_backoff * 2;
+ //vector org2 = w_org + w_backoff * 2;
//pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
}
METHOD(Vaporizer, wr_impacteffect, void(entity thiswep, entity actor))
{
- vector org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
if(w_deathtype & HITTYPE_SECONDARY)
{
pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
METHOD(Vortex, wr_impacteffect, void(entity thiswep, entity actor))
{
entity this = actor;
- vector org2 = w_org + w_backoff * 6;
+ vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
if(!w_issilent)
sound(this, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);