local entity ent, endent;
local float endq3surfaceflags;
float totaldmg;
+ entity o;
float length;
vector beampos;
// trace multiple times until we hit a wall, each obstacle will be made
// non-solid so we can hit the next, while doing this we spawn effects and
// note down which entities were hit so we can damage them later
+ o = self;
while (1)
{
if(self.antilag_debug)
- WarpZone_traceline_antilag (self, start, end, FALSE, self, self.antilag_debug);
+ WarpZone_traceline_antilag (self, start, end, FALSE, o, self.antilag_debug);
else
- WarpZone_traceline_antilag (self, start, end, FALSE, self, ANTILAG_LATENCY(self));
+ WarpZone_traceline_antilag (self, start, end, FALSE, o, ANTILAG_LATENCY(self));
+ if(o && WarpZone_trace_firstzone)
+ {
+ o = world;
+ continue;
+ }
// if it is world we can't hurt it so stop now
if (trace_ent == world || trace_fraction == 1)
if(!pseudoprojectile)
pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
- soundtoat(MSG_ONE, pseudoprojectile, beampos, CHAN_PROJECTILE, snd, VOL_BASE * f, ATTN_NONE);
+ soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTN_NONE);
}
if(pseudoprojectile)
f = ExponentialFalloff(mindist, maxdist, halflifedist, ent.railgundistance);
ffs = ExponentialFalloff(mindist, maxdist, forcehalflifedist, ent.railgundistance);
- if(accuracy_isgooddamage(self.owner, ent))
+ if(accuracy_isgooddamage(self.realowner, ent))
totaldmg += bdamage * f;
// apply the damage
damage_headshotbonus = self.dmg_edge * f;
railgun_start = self.origin - 2 * frametime * self.velocity;
railgun_end = self.origin + 2 * frametime * self.velocity;
- g = accuracy_isgooddamage(self.owner, other);
- Damage(other, self, self.owner, self.dmg * f, self.projectiledeathtype, self.origin, self.dmg_force * normalize(self.velocity) * f);
+ g = accuracy_isgooddamage(self.realowner, other);
+ Damage(other, self, self.realowner, self.dmg * f, self.projectiledeathtype, self.origin, self.dmg_force * normalize(self.velocity) * f);
damage_headshotbonus = 0;
if(headshot)
if(self.dmg_edge > 0)
{
if(headshot)
- AnnounceTo(self.owner, "headshot");
+ AnnounceTo(self.realowner, "headshot");
if(yoda)
- AnnounceTo(self.owner, "awesome");
+ AnnounceTo(self.realowner, "awesome");
}
// calculate hits for ballistic weapons
// do not exceed 100%
q = min(self.dmg * q, self.dmg_total + f * self.dmg) - self.dmg_total;
self.dmg_total += f * self.dmg;
- accuracy_add(self.owner, self.owner.weapon, 0, q);
+ accuracy_add(self.realowner, self.realowner.weapon, 0, q);
}
}
entity proj;
proj = spawn();
proj.classname = "bullet";
- proj.owner = self;
+ proj.owner = proj.realowner = self;
PROJECTILE_MAKETRIGGER(proj);
if(gravityfactor > 0)
{
trace_fraction = 0;
fireBallisticBullet_trace_callback_ent = self;
fireBallisticBullet_trace_callback_eff = eff;
- WarpZone_TraceToss_ThroughZone(self, oldself, world, fireBallisticBullet_trace_callback);
+ // FIXME can we somehow do this with just ONE trace?
+ WarpZone_TraceToss(self, self.owner);
+ if(self.owner && WarpZone_trace_firstzone)
+ {
+ self.owner = world;
+ self.velocity = v0;
+ self.gravity = g0;
+ continue;
+ }
+ WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback);
self.velocity = v0;
self.gravity = g0;